Pryme8 Posted September 22, 2017 Share Posted September 22, 2017 Is there a way to offset the grid material? Like move it a half unit in the x? example: https://playground.babylonjs.com/#URSDPL Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 22, 2017 Share Posted September 22, 2017 Unfortunately not out of the box but definitely a good idea Adding @Sebavan Quote Link to comment Share on other sites More sharing options...
Sebavan Posted September 22, 2017 Share Posted September 22, 2017 Sounds like a good idea :-), could you do the PR for it ? Pryme8 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted September 22, 2017 Author Share Posted September 22, 2017 Ill take a look at the github, Im sure its not a hard addition and I am sitting idle at work right now so might as well try to get a commit in.https://github.com/BabylonJS/Babylon.js/blob/master/dist/preview release/materialsLibrary/babylon.gridMaterial.d.tshttps://github.com/BabylonJS/Babylon.js/blob/master/dist/preview release/materialsLibrary/babylon.gridMaterial.js Are the only two files I can find on it, Where is the ts file that has the shader information in it?https://github.com/BabylonJS/Babylon.js/tree/master/materialsLibrary/src/grid NM found it... And I have no clue how to edit it... Like ts is putting me off from ever contributing, this sucks because I can "read" it but am clueless still on how to modify it, it looks off and my brain is wired to hard for vanilla js. I can edit the shader no problem but the ts part is just not something I am able to mess with. God I wish we were still using javascript... Quote Link to comment Share on other sites More sharing options...
Sebavan Posted September 22, 2017 Share Posted September 22, 2017 Np, If you send me the shader code I ll wire the properties in the ts file and you ll see how it is for the next time :-) adam and Pryme8 2 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted September 25, 2017 Author Share Posted September 25, 2017 deal! Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted September 25, 2017 Author Share Posted September 25, 2017 @Sebavan I have no way of testing this on the computer here at work but Im pretty sure the fragment shader just needs: This uniform: uniform vec3 gridOffset; And to change the line: vec3 gridPos=vPosition/gridRatio; to vec3 gridPos=(vPosition+gridOffset)/gridRatio; Quote Link to comment Share on other sites More sharing options...
Sebavan Posted September 25, 2017 Share Posted September 25, 2017 Thx I ll do ASAP Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted September 25, 2017 Author Share Posted September 25, 2017 *disclaimer* I'm not positive if that will fix it, but like 95% sure.... Thanks though buddy ^_^. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted September 25, 2017 Share Posted September 25, 2017 This is all in and as you can see, it is pretty straightforward in typescript: https://github.com/BabylonJS/Babylon.js/pull/2866 Pryme8 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted September 26, 2017 Author Share Posted September 26, 2017 So this should be active after the nightly build right? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 26, 2017 Share Posted September 26, 2017 IT is active now Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted September 27, 2017 Author Share Posted September 27, 2017 https://playground.babylonjs.com/#URSDPL#1 Yup it works! Yay thanks guys! @Deltakosh & @Sebavan GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 27, 2017 Share Posted September 27, 2017 Do you mind updating the doc with this new property? http://doc.babylonjs.com/extensions/grid https://github.com/BabylonJS/Documentation/blob/master/content/extensions/MaterialsLibrary/Grid.md Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted September 27, 2017 Author Share Posted September 27, 2017 Yes sir, Ill PR that today. *Done Quote Link to comment Share on other sites More sharing options...
Sebavan Posted September 27, 2017 Share Posted September 27, 2017 Thank you :-) it has been merged. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.