We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
But according to a user it can be made to work easily by following the instructions on this page: https://docs.unity3d.com/Manual/SinglePassInstancing.html
The text was updated successfully, but these errors were encountered:
thank @all-iver
the solution looks like that:
open your shapes.shader file and insert the lines flagged with //Inserted
struct appdata_t { float4 vertex : POSITION; float4 color : COLOR; float2 texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID // Inserted }; struct v2f { float4 pos : SV_POSITION; float2 uv : TEXCOORD0; float4 modelPos : TEXCOORD1; fixed4 color : COLOR; UNITY_VERTEX_OUTPUT_STEREO // Inserted }; v2f vert(appdata_t v) { v2f o; UNITY_SETUP_INSTANCE_ID(v); // Inserted UNITY_INITIALIZE_OUTPUT(v2f, o); // Inserted UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); // Inserted o.pos = UnityObjectToClipPos(v.vertex); // translate input uv coords (which are from 0 - 1 on either dimension) to something more // useful (-0.5 to 0.5). o.uv = v.texcoord.xy - 0.5; o.modelPos = v.vertex; // hijack modelPos.z to be distance from camera plane since it // isn't being used for anything else. used for pixel size. o.modelPos.z = -UnityObjectToViewPos(v.vertex).z; // for Unity versions < 5.4.0f3 // o.modelPos.z = -mul(UNITY_MATRIX_MV, v.vertex).z; o.color = v.color; return o; }
Sorry, something went wrong.
No branches or pull requests
But according to a user it can be made to work easily by following the instructions on this page: https://docs.unity3d.com/Manual/SinglePassInstancing.html
The text was updated successfully, but these errors were encountered: