Pryme8 Posted June 15, 2018 Share Posted June 15, 2018 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. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted June 18, 2018 Author Share Posted June 18, 2018 So I am pretty sure there is no UV being bound to an attribute on the shader with the Custom Material. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 18, 2018 Share Posted June 18, 2018 I noticed that all setTextures, setColor, setVector, setxxx are never updated. This has been often reported but does not seem to have been corrected since. I'm moving to mixMaterial and it works perfectly well for my needs. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted June 18, 2018 Author Share Posted June 18, 2018 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... Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted June 18, 2018 Author Share Posted June 18, 2018 http://www.babylonjs-playground.com/#678YAL#2 This is just a half thought, but what about something like this? *EDIT* and here is what it should look like if the setArray3 was working: http://www.babylonjs-playground.com/#157CS9#9 Quote Link to comment Share on other sites More sharing options...
Guest Posted June 18, 2018 Share Posted June 18, 2018 So is it CustomShader related or BJS related? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted June 18, 2018 Author Share Posted June 18, 2018 CustomMaterial related, trying to get it working fully. Quote Link to comment Share on other sites More sharing options...
Guest Posted June 18, 2018 Share Posted June 18, 2018 ok fair 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.