Hi,
I’m trying to write a surface shader that renders a cubemap on the material in worldspace (think:skybox) using:
texCUBE(_skybox, IN.viewDir);
When I do this on a shader that doesnt’t use a normalmap, I get the correct behavior, however, as soon as I try to add o.Normal as an output, viewDir now behaves differently. I guess, instead of using worldspace, it now uses objectspace? Is there any way to convert the objectspace viewDir back into worldspace? I’m having trouble finding any information about this, and unfortunately I’m still pretty much a novice at this kind of vector math :).
Any help on this will be greatly appreciated, thanks!