roberto.voxelfarm Posted September 16, 2019 Share Posted September 16, 2019 Hi, we are writing a custom deferred shader and we want to supply the normal in World Space, not Tangent Space. How can we achieve this? We do not want the value we supply in gbuffer.normal to be interpreted as if it was in Tangent Space. /roberto Link to comment
consta Posted September 17, 2019 Share Posted September 17, 2019 Hi roberto.voxelfarm. The main idea is deferred shader must return normal in view space. As I understand you want interpret normal map in world space. You should read normal from texture, then transform to view space with s_modelview. float4 normal_map = TEXTURE_BASE_NORMAL(TEX_NORMAL); GBUFFER.normal = normalize(mul3(s_modelview, normal_map)); roberto.voxelfarm 1 Link to comment
roberto.voxelfarm Posted September 18, 2019 Author Share Posted September 18, 2019 Thank you consta, This work perfect. Link to comment
Recommended Posts