Last active
November 22, 2022 13:29
-
-
Save Tunied/bee070920df6706f1551d4a228bc8d3a to your computer and use it in GitHub Desktop.
Check the video for more explain https://youtu.be/aMEu6FcdxFQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Eran/DrawProceduralIndirect/Basic" | |
{ | |
SubShader | |
{ | |
Tags | |
{ | |
"RenderPipeline"="UniversalPipeline" | |
"RenderType"="Opaque" | |
"Queue"="Geometry" | |
} | |
Pass | |
{ | |
Name "Dev01" | |
Cull Off | |
HLSLPROGRAM | |
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" | |
#pragma vertex v2f | |
#pragma fragment frag | |
#pragma target 5.0 | |
StructuredBuffer<float3> VertexDataArray; | |
// Structs | |
struct V2F_Input | |
{ | |
uint vertexID : SV_VertexID; | |
}; | |
struct V2F_Output | |
{ | |
float4 positionCS : SV_POSITION; | |
}; | |
// Vertex Shader | |
V2F_Output v2f(uint vertexID : SV_VertexID) | |
{ | |
V2F_Output OUT; | |
const VertexPositionInputs posGroup = GetVertexPositionInputs(VertexDataArray[vertexID]); | |
OUT.positionCS = posGroup.positionCS; | |
return OUT; | |
} | |
// Fragment Shader | |
half4 frag(V2F_Output IN) : SV_Target | |
{ | |
return half4(0.6, 0.3, 0.4, 1); | |
} | |
ENDHLSL | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you post the full shader code?