Jump to content

setArray3 on CustomMaterial && Add Varyings


Pryme8
 Share

Recommended Posts

http://www.babylonjs-playground.com/#157CS9#7


Got a few questions.  Starting at line 53, am I adding varying vars correctly?  What about the uniform array? What about Attributes like UV?

Also when setting the Uniform Array we have the method setColor3Array but no setVector3Array, so I am not sure if I am doing it correctly.  I even tried setArray3, but still no change.

Effectively I will see the colors move on the sphere in relation to the light[0] direction.  I will have sub-surface scattering if it kills me.

also noticed the uv is not carried over? I dont see it as an active attribute when I console.log(mat.getEffect()); and look at the report.

Link to comment
Share on other sites

Sounds like we need to rework the CustomMaterial.  Its everything I want/need,  just need to fix some stuff.

Does the mixMaterial allow custom injections into the shaders?

*UPDATE ON FIRST QUESTIONS*
The varyings can be set through the injections. -solved;
setters are broken on arrays. - not solved;
missing standard attributes. -not solved;


*THOUGHTS*
So the setters work on the ShaderMaterial as far as I know.  Is there a way we can have the CustomMaterial inherent the methods from both the StandardMaterial and ShaderMaterial?  I dont know TS well enough... 

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...