JohnK Posted October 31, 2015 Share Posted October 31, 2015 Have been playing around with CYOS and shaders to see how the ground can be transformed into different shapes and came across these 3D equations on Ben Joffe's site, so played around with some on this playground http://www.babylonjs-playground.com/#TWH8K#1 Thanks to DK for CYOS and the documentation. Given the danger of teaching my Grandmother to suck eggs I will still go ahead and state some obvious things:- 1. about the PG Lines 31, 32 and 33 in the PG contain the functions to determine the height of the ground (v.y) based on the x and z positions on the ground. Comment any two of these out or replace with your own function. Line 34 sets the movement within the shader comment out to stop this. You can see just the effect the shader has on the height of the ground by swapping which of lines 82 and 83 are commented out. (Just using CreateGround is less fun than CreateGroundFromHeightMap imho.) 2. I learnt about shaders When writing the functions in the BABYLON.Effect.ShadersStore["customVertexShader"] Do not use integers, ie write 2.0 not 2Maths functions are not methods of a Math object as in JS so write sin not Math.sinThe available maths function can be found on page 11 of this OpenGL pdf document Enjoy jerome and Wingnut 2 Quote Link to comment Share on other sites More sharing options...
Temechon Posted October 31, 2015 Share Posted October 31, 2015 Hi John, For me, shaders are really complex and difficult to understand. However, I did give it a try several month ago, and I did these below. Maybe it will be useful for someone (but I really doubt it ) cross-stitch : http://www.babylonjs.com/cyos/#1G3RU Colorify : http://www.babylonjs.com/cyos/#USC12 Lens post-process: http://www.babylonjs-playground.com/#EKICU#2 Bleach : http://www.babylonjs.com/cyos/#LIMKT Wingnut and JohnK 2 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted October 31, 2015 Share Posted October 31, 2015 Given the danger of teaching my Grandmother to suck eggs hahahaha. I had to go to the dictionary of comedy with that one. No entry. hmm. "Tie shoes" or "sweep floors"... those were in the dictionary... but not "suck eggs". That blew everyone's mind! Thanks for the info/demos about coding shaders, you guys. JohnK 1 Quote Link to comment Share on other sites More sharing options...
JohnK Posted October 31, 2015 Author Share Posted October 31, 2015 Hole in the sky http://www.babylonjs-playground.com/#TWH8K#2 Wingnut and jerome 2 Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted October 31, 2015 Share Posted October 31, 2015 Oooww JohnK you've just created a wormhole in space and time ! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 31, 2015 Share Posted October 31, 2015 Did you see that we started the Materials library?https://github.com/BabylonJS/Babylon.js/tree/master/materialsLibrary Documentationhttp://doc.babylonjs.com/tutorials/How_to_create_a_material_for_materialsLibrary We started with the water material:https://github.com/BabylonJS/Babylon.js/tree/master/materialsLibrary/materials/water iiceman and Flomotion 2 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.