I had a look at the node material today and it fascinates me. Is there already a new version of StandardMaterial that is based on a node graph? I would like to create a derived version but re-use e.g. the shadow map capabilities of StandardMaterial.
I was asking because @sebavan said “the break” which sounded like a certain, well-known, break to me. Could be a break in a regular webinar or some other occasion, that’s why I asked for the occasion. Maybe, I am missing some occasion that is well-known to this community.
On the other hand, I heard that the U.S. have “labor day” today, so maybe that’s what he means by “break”.
This is the 8th version of the first playground that Deltakosh showed us… in his “sneak peek” thread.
I fixed it up… adjusted a few knownValues vs. systemValues… removed a whole lot of mesh, and got it working on a simple box. (it wasn’t difficult at all, really)
Line 77 is where the nodeMaterial is applied to the box.
I think… just push the large EDIT button on the right (on the inspector)… and you should see the NME launch with a flowView of the current red box material. I changed the box color to green, and it worked… so other things might work, too.
The NME is pretty much alpha-ish and still well under dev… so… um… perhaps keep future playground saves that WE do… all within the #4I3SIR series. That way, when things change in the NME, we don’t have lots of playground series to fix. Instead, they will all be within the #4I3SIR series.
I don’t know if it can still be called a “standardMaterial”… but it’s darned close to being one.
Potentially stupid statement by Wingnut: All BJS materials, standard or advanced… are made from shaders and post-processes… behind the scenes. If correct, we ARE seeing a fairly accurate flowView of a bare-bones standard material… in the above playground. Most of us… just have never seen its shader code… represented in a flow-view way, before now. I could be completely wrong, though.
thanks for the playground. By “standard material”, I mean: can it receive shadows, i.e. using the usual ShadowGenerator, and: does it support specular lighting?
Or, are shadows and specular lighting each “just another node”?
Anyway, sounds like it’s time to throw away my custom ShaderMaterial and replace it by a NodeMaterial.
Ahh… ok, sorry I misunderstood about that. Yeah, those are excellent questions you raise. Let’s listen to comments from the pros (like you).
Are you going to test some speculars and shadows on the above PG series? Teach/show us what you learn, ok? Perhaps we need to wire-up some light nodes to the box material? Got the docs memorized?
YOU might be the #1 or #2 expert on this new system, at this time. If you go experimenting… please teach us what you learn. thx!
I went into the editor and clicked “Export shaders”. The shader code that was generated by the NodeMaterial shows that lighting is not included but has to be modeled using more nodes. When I saw that, I thought “duh, of course!”. (So, forget my stupid question from above).
So, what I need is a simple example how to connect a NodeMaterial to a ShadowGenerator. I think, the rest will be quite easy.
Hey:) it will be automatically done:) as long as you add a light node, the node will take care of the shadows as well and if your light has a shadowgenerator then magic will happen;)
In a nutshell, wiring a light node is all that you need:)
Hey this comes in handy! I am just in the middle of tinkering with it. The light node wants a world position input – where do I get it from? is it the world position of the light itself?
The box looks green with specular lighting, as expected.
HOWEVER: When I generate the code and put it back into the original playground, I see a black box instead of a green box.
See here: https://playground.babylonjs.com/#4I3SIR#9
What I need now is a node for which I can write the shader code by myself. Example: Height-dependent colors for a terrain, done in the fragment shader.