Update lightning on Instance with NodeMaterial


I made the example PG of the problem. I noticed that after changing my mesh instances rotation the light shading is wrong. Some faces are pointing directly in the light direction but are black.

The result is like this:

How do I force an update of light from code after I position all my instances? Cause now the 3rd instance should have similar front face colors as the original but is black. I actually do not want to update this every frame, cause the mesh will be stationary so I actually like that the shading is not calculated all the time. Just need to update it once after I position all my instances.


Looks like a bug to me :frowning: adding @Evgeni_Popov who knows a lot about node materials

Hi Sebastian (pan w wanie)

You know, if it i’s a bug them maybe we can move it to bugs?

But I do not want to work fully as it should at least with some settings maybe. I like the fact that this is almost like backed shadows and It works super for me. I just want to force an update on it to recalculate the shading after positioning and then I will like it to be fully stationary.


Your node material is wrong, the transformation to use in the World normal block is not World, it is the output from the Instances block as you are using instances in your PG:


1 Like

You guys are the best :slight_smile:


Sorry cause I got you on the topic.

How can I make shadows gray instead of black, with a light shadow node? The side that does not have any light is solid black and I need it to have some light like fake it.




You can either add an ambient component to your material or add a hemispheric light with a low intensity.

Using an ambient component:


Ok but this does not work with texture. I was hoping for a general rule to control shadow intensity that I do not know in NME.

Yes it works with textures too, you can add the ambient color to the texture values.

Note that you can control the shadow intensity when using a shadow generator, but the darker sides of the cubes in your PG are not shadows per see, it’s only that those faces receive less/no lights.

Blockquote @Evgeni_Popov
faces receive less/no lights

And this is exactly what I’m interested in tricking to not be black. And with textures, it’s not working for me at all. I get grey colour :confused: It there a way around it. To have a texture less shaded all arround? so I can control how much darker it will be in those less no shadows areas?



Thanks for fixing the Gradient Bug BTW

You should multiply the ambient color with the color texture to achieve what you want:


1 Like