Skip to content

Commit

Permalink
Added wind sway to "real" tree shadows
Browse files Browse the repository at this point in the history
Added support for wind sway to "real" tree shadows. Requires FusionFix to work.
  • Loading branch information
Parallellines0451 committed Jul 18, 2023
1 parent 3db3ed4 commit 3d26ef5
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,17 @@
<Item>
<DataType>asm</DataType>
<File>gta_trees\gta_treesVS3.asm</File>
<Variables value="2" >
<Variables value="3" >
<Item>
<Type>float4x4</Type>
<Name>gShadowMatrix</Name>
<Index value="60" />
</Item>
<Item>
<Type>float4</Type>
<Name>colorize</Name>
<Index value="51" />
</Item>
<Item>
<Type>float4x4</Type>
<Name>gWorld</Name>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,77 @@
//
// Added wind sway to tree shadows and added support for FusionFix's DynamicShadowForTrees
// Generated by Microsoft (R) HLSL Shader Compiler 9.26.952.2844
//
// Parameters:
//
// float4 CustomWindSway;
// row_major float4x4 gShadowMatrix;
// float4 colorize;
// row_major float4x4 gWorld;
//
//
// Registers:
//
// Name Reg Size
// ------------- ----- ----
// gWorld c0 4
// gShadowMatrix c60 4
// Name Reg Size
// ---------------- ----- ----
// gWorld c0 4
// colorize c51 1
// gShadowMatrix c60 4
// CustomWindSway c233 1 // Not defined in the xml as a local variable to avoid having to edit tree models
//

vs_3_0
def c4, 1, 0, 0, 0
def c4, 0.00499999989, 0.00999999978, 0, 1
def c5, 9.99999975e-006, 0.5, 0.0318309888, 0
def c6, 6.28318548, -3.14159274, 0, 0
dcl_position v0
dcl_texcoord v1
dcl_position o0
dcl_texcoord o1.xyz
mul r0.xyz, c1, v0.y
mad r0.xyz, v0.x, c0, r0
mad r0.xyz, v0.z, c2, r0
mul r0.xyz, c4.zwzw, v0.zxyw
mad r0.xyz, v0.yzxw, c4.wzzw, -r0
add r0.xyz, r0, c5.x
nrm r1.xyz, r0
dp3 r0.x, v0, v0
rsq r0.x, r0.x
rcp r0.x, r0.x
mad r0.y, r0.x, c4.x, c4.y
mov r20, c51
mov r21, c4
if_eq c51.w, r21.w
if_ne c233.w, r21.z
mov r20, c233
endif
endif
mul r0.x, r0.x, r20.w
// mul r0.x, r0.x, c51.w
mad r0.x, r0.x, c5.z, c5.y
frc r0.x, r0.x
mad r0.x, r0.x, c6.x, c6.y
sincos r2.xy, r0.x
mul r0.xzw, r1.xyyz, r0.y
mul r1.xyz, r0.wxzw, v0.yzxw
mad r1.xyz, r0.zwxw, v0.zxyw, -r1
mad r0.xzw, r0, r2.y, v0.xyyz
add r1.xyz, r1, c5.x
nrm r3.xyz, r1
mul r1.xyz, r0.y, r3
mul r1.xyz, r1, c5.y
mad r3.xyz, r1, r2.x, r0.xzww
mul r0.xyz, c1, r3.y
mad r0.xyz, r3.x, c0, r0
mad r0.xyz, r3.z, c2, r0
add r0.xyz, r0, c3
mul r1, r0.y, c61
mad r1, r0.x, c60, r1
mad r0, r0.z, c62, r1
add r0, r0, c63
min r0.z, r0.z, c4.x
add o0.z, -r0.z, c4.x
mad o0.xyw, r0.xyzx, c4.xxzy, c4.yyzx
min r0.z, r0.z, c4.w
add o0.z, -r0.z, c4.w
mad o0.xyw, r0.xyzx, c4.wwzz, c4.zzzw
mov o1.x, r0.w
mov o1.yz, v1.xxyw

Expand Down

0 comments on commit 3d26ef5

Please sign in to comment.