Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have a precompiled version of a shader. What should I do to decompile it? #11

Open
Albeoris opened this issue Jul 13, 2021 · 0 comments

Comments

@Albeoris
Copy link

Albeoris commented Jul 13, 2021

I have a disassembled version of a shader. What should I do to decompile it?

Shader "SFX_SUB_G" {
	Properties {
		_Color ("Color", Color) = (2,2,2,1)
		_Threshold ("Threshold", Float) = 0.0295
	}
	SubShader { 
		Tags { "ForceSupported"="true" "RenderType"="Overlay" }
		Pass {
			Tags { "ForceSupported"="true" "RenderType"="Overlay" }
			ZWrite Off
			Cull Off
			Blend One One
			BlendOp RevSub
			GpuProgramID 39892
			Program "vp" {
				SubProgram "d3d9 " {
					Bind "vertex" Vertex
					Bind "color" Color
					Matrix 0 [glstate_matrix_projection]
					Vector 5 [_Color]
					Vector 4 [_ProjectionParams]
					"vs_2_0
						def c6, 20, 1, 0, 0
						dcl_position v0
						dcl_color v1
						mov r0.zw, c6.y
						mov r1.x, c6.x
						add r1.x, r1.x, c4.y
						add r1.z, -r1.x, v0.z
						mov r0.xy, -r1.z
						mov r1.xyw, v0
						dp4 r2.x, c0, r1
						dp4 r2.y, c1, r1
						dp4 r2.z, c2, r1
						dp4 r2.w, c3, r1
						mul r0, r0, r2
						rcp r1.x, r0.w
						mul r0, r0, r1.x
						max r0.z, r0.z, c6.z
						mov oPos.xyw, r0
						min oPos.z, r0.z, c6.y
						mul r0.xyz, v1, c5
						mul oD0.xyz, r0, v1.w
						mov oD0.w, c6.y
						
						"
				}
			}
			Program "fp" {
				SubProgram "d3d9 " {
					"ps_2_0
						dcl v0
						mov oC0, v0
						
						"
				}
			}
		}
	}
	Fallback "Diffuse"
}
@Albeoris Albeoris changed the title I have a disassembled version of a shader. What should I do to decompile it? I have a precompiled version of a shader. What should I do to decompile it? Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant