MackeyK24 Posted October 21, 2016 Share Posted October 21, 2016 How should the son look for a Shader Material to specify initial shader properties. For example: { "customType" : "BABYLON.ShaderMaterial", "name" : "Items", "id" : "4341eb56-9415-44c4-a1c4-3236afe7df56", "backFaceCulling" : true, "wireframe" : false, "alpha" : 1, "shaderPath" : "AmigaShader", "options" : { "attributes" : [], "uniforms" : [], "needAlphaBlending" : false, "needAlphaTesting" : false, "samplers" : [], "defines" : [] }, "textures" : {}, "floats" : {}, "floatArrays" : {}, "colors3" : {}, "colors4" : {}, "vectors2" : {}, "vectors3" : {}, "vectors4" : {}, "matrices" : {}, "matrices2x2" : {}, "matrices3x3" : {} } So if did something like: "floats" : { "FloatParam1" : 1.0, "FloatParam2" : 2.0, "FloatParam3" : 3.0 } Is that basically the same thing as on client code: shader.setFloat("FloatParam1", 1.0); shader.setFloat("FloatParam2", 2.0); shader.setFloat("FloatParam3", 1.0); Will the scene loader automatically set these initial floats on the shader or do i still have to manually use client code look myself if shaderMaterial.floats has any key paris and manually class shader.setFloat for each key value pair defined in the shader material son as shown above? What goes in textures {} ... A key value pair of "name" --> BabylonTexture ? And will those textures get loaded as the initial shader.setTexture values or do i gotta manually load those as well? Quote Link to comment Share on other sites More sharing options...
MackeyK24 Posted October 21, 2016 Author Share Posted October 21, 2016 Never mind... Im a dumb ass... Should have look as shaderMaterial.ts FIRST. All questions answered from that... Basically everything handled from ShaderMaterial.Parse... So as long as i produce the proper json for ShaderMaterial i should be all good. Unless i got it wrong... Please let me know GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted October 21, 2016 Share Posted October 21, 2016 you look for ShaderBuilder too that is not json structure but if you interested to make shader in easy way that can help you . 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.