Instance Shader Light scaling problem

Hi

I made a PG demonstrating my problem.

When I add scaling to an instance with a shader on it the light is overpowered.

image

I would like the shader to work as the line of spheres above in the PG.

image

How can I achieve this? Thanks.

Regards
Peter

You should normalize the normal:

When scaling is (1,1,1) you don’t need to do it, but in your case you have to.

Thanks :slight_smile: It’s again a small thing that there is no real way to know that you need to do it.

Do you plan to have a seminar about shaders or something? YT videos are great but they do not cover all of it.

Thanks Again

Peter

It’s hard to explain everything in videos / docs: that’s when this forum is useful :slight_smile:!

So what is the functionality in a nutshell of Normalize Block in my case?

It’s simply normalizing a vector, meaning making sure its length is 1. For lighting computation, the normal must be a unit vector: the Light block is expecting a unit vector for worldNormal. The block does not normalize the vector itself to avoid a useless operation in case the vector would already be normalized.

Thank you for the explanation :slight_smile: