Fix normal storage into texture data. Input [-1..1] should be output to [0..1]
This commit is contained in:
parent
55105baa25
commit
8a382cd536
1 changed files with 2 additions and 2 deletions
|
@ -817,7 +817,7 @@ const char *sunlight_frag_src = ""
|
|||
" if ( spec_emis.a < 0.1 )\n"
|
||||
" discard;\n"
|
||||
" vec3 normal;\n"
|
||||
" normal.xy = texture2D( normal_tex, coords ).rg;\n"
|
||||
" normal.xy = texture2D( normal_tex, coords ).rg * 2.0 - vec2(1.0,1.0);\n"
|
||||
" normal.z = sqrt( 1.0 - dot( normal.xy, normal.xy ) );\n"
|
||||
" float len = length(normal);\n"
|
||||
" normal /= len;\n"
|
||||
|
@ -883,7 +883,7 @@ const char *fog_frag_src = ""
|
|||
" if ( initialized < 0.1 )\n"
|
||||
" discard;\n"
|
||||
" vec3 normal;\n"
|
||||
" normal.xy = texture2D( normal_tex, coords ).rg;\n"
|
||||
" normal.xy = texture2D( normal_tex, coords ).rg * 2.0 - vec2(1.0,1.0);\n"
|
||||
" normal.z = sqrt( 1.0 - dot( normal.xy, normal.xy ) );\n"
|
||||
" float len = length(normal);\n"
|
||||
" normal /= len;\n"
|
||||
|
|
Loading…
Add table
Reference in a new issue