Jump to content

[SOLVED] - ShaderMaterial JSON


MackeyK24
 Share

Recommended Posts

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?

 

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...