Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Assets/Gothic-Core/Shaders/ThunderShader.shader
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,24 @@ Shader "Unlit/ThunderShader"
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
// VR: stereo instancing - without it single-pass instanced drew the lightning only for the left eye.
#pragma multi_compile_instancing

#include "UnityCG.cginc"

struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};

struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
float visibility : TEXCOORD1; // Interpolated visibility value
UNITY_VERTEX_OUTPUT_STEREO
};

sampler2D _MainTex;
Expand All @@ -46,6 +50,8 @@ Shader "Unlit/ThunderShader"
v2f vert(appdata v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
// Pass through a visibility value, which could be based on a vertex attribute or calculated.
Expand Down