- Home /
Question by
johncoco_12 · Nov 09, 2020 at 02:42 PM ·
shadershader programmingdirectxdirectx 11
Needing help to fix my old 2012 shader!
Hi i found my old Shader from 2012 were unity web player was a thing the probleme now is that is that the shader is broken and i need help to fix it // i get a TVAL_ID Error
Shader "Toon/Basic" {
Properties {
_Color ("Main Color", Color) = (0.5,0.5,0.5,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_ToonShade ("ToonShader Cubemap(RGB)", CUBE) = "" { TexGen CubeNormal }
}
SubShader {
Tags { "RenderType"="Opaque" }
Pass {
Name "BASE"
Tags { "RenderType"="Opaque" }
Cull Off
Program "vp" {
SubProgram "opengl " {
Bind "vertex" Vertex
Bind "normal" Normal
Bind "texcoord" TexCoord0
Vector 9 [_MainTex_ST]
"!!ARBvp1.0
# 10 ALU
PARAM c[10] = { { 0 },
state.matrix.modelview[0],
state.matrix.mvp,
program.local[9] };
TEMP R0;
MOV R0.w, c[0].x;
MOV R0.xyz, vertex.normal;
DP4 result.texcoord[1].z, R0, c[3];
DP4 result.texcoord[1].y, R0, c[2];
DP4 result.texcoord[1].x, R0, c[1];
MAD result.texcoord[0].xy, vertex.texcoord[0], c[9], c[9].zwzw;
DP4 result.position.w, vertex.position, c[8];
DP4 result.position.z, vertex.position, c[7];
DP4 result.position.y, vertex.position, c[6];
DP4 result.position.x, vertex.position, c[5];
END
# 10 instructions, 1 R-regs
"
}
SubProgram "d3d9 " {
Bind "vertex" Vertex
Bind "normal" Normal
Bind "texcoord" TexCoord0
Matrix 0 [glstate_matrix_modelview0]
Matrix 4 [glstate_matrix_mvp]
Vector 8 [_MainTex_ST]
"vs_2_0
; 10 ALU
def c9, 0.00000000, 0, 0, 0
dcl_position0 v0
dcl_texcoord0 v1
dcl_normal0 v2
mov r0.w, c9.x
mov r0.xyz, v2
dp4 oT1.z, r0, c2
dp4 oT1.y, r0, c1
dp4 oT1.x, r0, c0
mad oT0.xy, v1, c8, c8.zwzw
dp4 oPos.w, v0, c7
dp4 oPos.z, v0, c6
dp4 oPos.y, v0, c5
dp4 oPos.x, v0, c4
"
}
}
Program "fp" {
SubProgram "opengl " {
Vector 0 [_Color]
SetTexture 0 [_MainTex] 2D
SetTexture 1 [_ToonShade] CUBE
"!!ARBfp1.0
OPTION ARB_precision_hint_fastest;
# 6 ALU, 2 TEX
PARAM c[2] = { program.local[0],
{ 2 } };
TEMP R0;
TEMP R1;
TEX R0, fragment.texcoord[0], texture[0], 2D;
TEX R1.xyz, fragment.texcoord[1], texture[1], CUBE;
MUL R0, R0, c[0];
MUL R0.xyz, R1, R0;
MUL result.color.xyz, R0, c[1].x;
MOV result.color.w, R0;
END
# 6 instructions, 2 R-regs
"
}
SubProgram "d3d9 " {
Vector 0 [_Color]
SetTexture 0 [_MainTex] 2D
SetTexture 1 [_ToonShade] CUBE
"ps_2_0
; 5 ALU, 2 TEX
dcl_2d s0
dcl_cube s1
def c1, 2.00000000, 0, 0, 0
dcl t0.xy
dcl t1.xyz
texld r0, t1, s1
texld r1, t0, s0
mul r1, r1, c0
mul r0.xyz, r0, r1
mov r0.w, r1
mul r0.xyz, r0, c1.x
mov oC0, r0
"
}
}
}
}
SubShader {
Tags { "RenderType"="Opaque" }
Pass {
Name "BASE"
Tags { "RenderType"="Opaque" }
Cull Off
SetTexture [_MainTex] { ConstantColor [_Color] combine texture * constant }
SetTexture [_ToonShade] { combine texture * previous double, previous alpha }
}
}
Fallback "VertexLit"
}
Comment
Your answer
Follow this Question
Related Questions
Compute Shader crashes when buffer is too big 0 Answers
Scene Color Node in Shader Graph not working with Unity's 2D Renderer and URP 5 Answers
Distortion Shader does not render transparent objects (Shader Graph) 2 Answers
The Best Way To Make Stylised Grass in Unity? 0 Answers
How to get the value of a pixel of a noise node if it's greater than some threshold? 0 Answers