Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Borod4r/1c4e7598d69956d307dd1bbc98f85bba to your computer and use it in GitHub Desktop.
Save Borod4r/1c4e7598d69956d307dd1bbc98f85bba to your computer and use it in GitHub Desktop.
Farland Skies - Low Poly : Support for Single Pass Instanced Rendering
Index: Assets/Farland Skies/Low Poly/Shaders/LowPolySkybox.shader
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- Assets/Farland Skies/Low Poly/Shaders/LowPolySkybox.shader (revision f7d4f5a635024a416281d68bf3f41fae11268f8d)
+++ Assets/Farland Skies/Low Poly/Shaders/LowPolySkybox.shader (date 1563453196180)
@@ -105,6 +105,14 @@
// Structs
// -----------------------------------------
+ struct appdata
+ {
+ float4 vertex : POSITION;
+
+ // Single pass instanced rendering
+ UNITY_VERTEX_INPUT_INSTANCE_ID
+ };
+
struct v2f {
float4 position : SV_POSITION;
float3 vertex : TEXCOORD0;
@@ -121,6 +129,9 @@
#if !STARS_OFF
float3 twinklingPosition : TEXCOORD4;
#endif
+
+ // Single pass instanced rendering
+ UNITY_VERTEX_OUTPUT_STEREO
};
// -----------------------------------------
@@ -154,9 +165,15 @@
}
#endif
- v2f vert(appdata_base v)
+ v2f vert(appdata v)
{
v2f OUT;
+
+ // Single pass instanced rendering
+ UNITY_SETUP_INSTANCE_ID(v);
+ UNITY_INITIALIZE_OUTPUT(v2f, OUT);
+ UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT);
+
OUT.position = UnityObjectToClipPos(v.vertex);
OUT.vertex = v.vertex;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment