Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
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
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

212 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges