Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Seyed_Morteza_Kamaly · Aug 21, 2017 at 10:08 AM · unity 5shaderlabtessellation

Accessing vertex position in surf directly without vert's out parameter

I have problem with output vertex In Tesselation Shader How can I fix it? https://forum.unity3d.com/threads/accessing-vertex-position-in-surf-directly-without-verts-out-parameter.432333/

    Shader "Tessellation Sample" {
                 Properties {
                     _EdgeLength ("Edge length", Range(2,50)) = 15
                     _MainTex ("Base (RGB)", 2D) = "white" {}
                     _DispTex ("Disp Texture", 2D) = "gray" {}
                     _NormalMap ("Normalmap", 2D) = "bump" {}
                     _Displacement ("Displacement", Range(0, 1.0)) = 0.3
                     _Color ("Color", color) = (1,1,1,0)
                     _SpecColor ("Spec color", color) = (0.5,0.5,0.5,0.5)
                 }
                 SubShader {
                     Tags { "RenderType"="Opaque" }
                     LOD 300
                     
                     CGPROGRAM
                     #pragma surface surf BlinnPhong addshadow fullforwardshadows vertex:disp tessellate:tessEdge nolightmap
                     #pragma target 4.6
                     #include "Tessellation.cginc"
         
                     float _EdgeLength;
         
                     float4 tessEdge (appdata_full v0, appdata_full v1, appdata_full v2)
                     {
                         return UnityEdgeLengthBasedTess (v0.vertex, v1.vertex, v2.vertex, _EdgeLength);
                     }
         
                     float _Displacement;
         
         
                     struct Input {
                         float4 position  : POSITION;
                         float3 worldPos  : TEXCOORD2;    // Used to calculate the texture UVs and world view vector
                         float4 proj0        : TEXCOORD3;    // Used for depth and reflection textures
                         float4 proj1     : TEXCOORD4;    // Used for the refraction texture
                     };
         
                     void disp (inout appdata_full v, out Input o){
                     UNITY_INITIALIZE_OUTPUT(Input,o);
                     o.worldPos = v.vertex.xyz;
                     o.position = UnityObjectToClipPos(v.vertex);
                     o.proj0 = ComputeScreenPos(o.position);
                     COMPUTE_EYEDEPTH(o.proj0.z);
                 
                     o.proj1 = o.proj0;
                     #if UNITY_UV_STARTS_AT_TOP
                     o.proj1.y = (o.position.w - o.position.y) * 0.5;
                     #endif
                     }
         
                     sampler2D _MainTex;
                     sampler2D _NormalMap;
                     fixed4 _Color;
         
                     void surf (Input IN, inout SurfaceOutput o) {
                         o.Albedo = float4(0,0,0,0);
                     }
                     ENDCG
                 }
                 FallBack "Diffuse"
             }

how can I fix it Shader error in 'Tessellation Sample': 'disp': no matching 1 parameter function at line 230 (on d3d11)

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

136 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

Related Questions

Simple cartoon water shader shoreline 1 Answer

Would learning some GLSL help with Unity Shading? 1 Answer

Additive Surface Shader in Unity 5 1 Answer

someone knows how to create an anisotropic shader? HELP!!! 0 Answers

How to get a Tangent space to object space Matrix in shader 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