NME lightInfomation Bug

NME LightInfomationNode can not calculate point/spot/hemisphere light’s direction right.
I check code generated by NME, it need define LIGHTPOINTTYPE0, after my testing, I find that it is always undefine. lightDir always equal lightData.xyz
image

but in pbr, it is determined by those:


in others, it is determined by those


image

I didn’t find define keyword “LIGHTPOINTTYPE0” anyway, I think it may a mistake.

directional light:https://playground.babylonjs.com/#8NL9PJ#1
point light :Babylon.js Playground
NME:https://nme.babylonjs.com/#DYIDHI#2

@Evgeni_Popov will have a look in no time :slight_smile:

It does work if you set the light to be used by the LightInformation block beforehands:

https://playground.babylonjs.com/#8NL9PJ#3

(note that I have modified your (-1,-1,-1) vector to (1,1,1) in the node material to get a non all-black display)

If you don’t set the light, the block will automatically use the first light of the scene but won’t set the LIGHTTYPE define correctly if it is a light point. Here’s a PR that will correct that:

4 Likes

Thank you!!! :grin:

1 Like