Skip to content

Commit

Permalink
game_dir: glsl: fixed parallax mapping for deferred rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
SNMetamorph committed Dec 11, 2023
1 parent 06f4084 commit a49bfcc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions game_dir/glsl/deferred/scene_bmodel_fp.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ varying vec2 var_TexDiffuse;
varying vec2 var_TexDetail;
varying vec2 var_TexGlobal;
varying vec3 var_Position;
varying vec3 var_ViewDir;
varying vec4 var_LightNums0;
varying vec4 var_LightNums1;

Expand Down
2 changes: 2 additions & 0 deletions game_dir/glsl/deferred/scene_bmodel_vp.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ varying vec2 var_TexDiffuse;
varying vec2 var_TexDetail;
varying vec2 var_TexGlobal;
varying vec3 var_Position;
varying vec3 var_ViewDir;
varying vec4 var_LightNums0;
varying vec4 var_LightNums1;

Expand All @@ -56,6 +57,7 @@ void main( void )
var_TexDetail = ( attr_TexCoord0.xy + u_TexOffset ) * u_DetailScale;
var_TexGlobal = attr_TexCoord0.zw;
var_Position = worldpos.xyz;
var_ViewDir = (u_ViewOrigin.xyz - worldpos.xyz) * var_WorldMat;

if( u_ViewOrigin.w != 0.0 )
{
Expand Down

0 comments on commit a49bfcc

Please sign in to comment.