| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- Technique : base("VolumeRenderBase") =
- {
- Language = "HLSL11";
-
- Pass =
- {
- DepthWrite = false;
- DepthRead = false;
-
- Common =
- {
- struct VStoGS
- {
- float4 position : SV_POSITION;
- float2 uv0 : TEXCOORD0;
- uint layerIdx : TEXCOORD1;
- };
-
- struct GStoFS
- {
- float4 position : SV_POSITION;
- float2 uv0 : TEXCOORD0;
- uint layerIdx : SV_RenderTargetArrayIndex;
- };
- };
- Vertex =
- {
- struct VertexInput
- {
- float2 screenPos : POSITION;
- float2 uv0 : TEXCOORD0;
- uint layerIdx : SV_InstanceID;
- };
-
- VStoGS main(VertexInput input)
- {
- VStoGS output;
-
- output.position = float4(input.screenPos, 0, 1);
- output.uv0 = input.uv0;
- output.layerIdx = input.layerIdx;
-
- return output;
- }
- };
-
- Geometry =
- {
- [maxvertexcount(3)]
- void main(triangle VStoGS input[3], inout TriangleStream<GStoFS> outStream)
- {
- GStoFS vert0;
- vert0.position = input[0].position;
- vert0.uv0 = input[0].uv0;
- vert0.layerIdx = input[0].layerIdx;
- GStoFS vert1;
- vert1.position = input[1].position;
- vert1.uv0 = input[1].uv0;
- vert1.layerIdx = input[1].layerIdx;
- GStoFS vert2;
- vert2.position = input[2].position;
- vert2.uv0 = input[2].uv0;
- vert2.layerIdx = input[2].layerIdx;
- outStream.Append(vert0);
- outStream.Append(vert1);
- outStream.Append(vert2);
- }
- };
- };
- };
- Technique : base("VolumeRenderBase") =
- {
- Language = "GLSL";
-
- Pass =
- {
- DepthWrite = false;
- DepthRead = false;
-
- Vertex =
- {
- in vec2 bs_position;
- in vec2 bs_texcoord0;
-
- out VStoGS
- {
- vec2 uv0;
- flat int layerIdx;
- } VSOutput;
-
- out gl_PerVertex
- {
- vec4 gl_Position;
- };
-
- void main()
- {
- gl_Position = vec4(bs_position, 0, 1);
- VSOutput.uv0 = bs_texcoord0;
- VSOutput.layerIdx = int(gl_InstanceID);
- }
- };
-
- Geometry =
- {
- layout (triangles) in;
- layout (triangle_strip, max_vertices=3) out;
-
- in VStoGS
- {
- vec2 uv0;
- flat int layerIdx;
- } GSInput[3];
-
- out GStoFS
- {
- vec2 uv0;
- } GSOutput;
-
- in gl_PerVertex
- {
- vec4 gl_Position;
- } gl_in[];
-
- out gl_PerVertex
- {
- vec4 gl_Position;
- };
-
- out int gl_Layer;
-
- void main()
- {
- gl_Layer = GSInput[0].layerIdx;
-
- gl_Position = gl_in[0].gl_Position;
- GSOutput.uv0 = GSInput[0].uv0;
- EmitVertex();
-
- gl_Position = gl_in[1].gl_Position;
- GSOutput.uv0 = GSInput[1].uv0;
- EmitVertex();
-
- gl_Position = gl_in[2].gl_Position;
- GSOutput.uv0 = GSInput[2].uv0;
- EmitVertex();
- }
- };
- };
- };
|