| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- Parameters =
- {
- mat4x4 worldTransform;
- float invViewportWidth;
- float invViewportHeight;
- color tint;
- };
- Technique =
- {
- Language = "HLSL11";
-
- Pass =
- {
- Target =
- {
- Blend = true;
- Color = { SRCA, SRCIA, ADD };
- WriteMask = RGB;
- };
-
- DepthRead = false;
- DepthWrite = false;
-
- Multisample = false; // This controls line rendering algorithm
- AALine = true;
-
- Common =
- {
- struct VStoFS
- {
- float4 position : SV_POSITION;
- };
- };
-
- Vertex =
- {
- float invViewportWidth;
- float invViewportHeight;
- float4x4 worldTransform;
- struct VertexInput
- {
- float2 position : POSITION;
- };
-
- VStoFS main(VertexInput input)
- {
- float4 tfrmdPos = mul(worldTransform, float4(input.position, 0, 1));
-
- float tfrmdX = -1.0f + (tfrmdPos.x * invViewportWidth);
- float tfrmdY = 1.0f - (tfrmdPos.y * invViewportHeight);
- VStoFS output;
- output.position = float4(tfrmdX, tfrmdY, 0, 1);
- return output;
- }
- };
-
- Fragment =
- {
- float4 tint;
-
- float4 main(VStoFS input) : SV_Target
- {
- return tint;
- }
- };
- };
- };
- Technique =
- {
- Language = "GLSL";
-
- Pass =
- {
- Target =
- {
- Blend = true;
- Color = { SRCA, SRCIA, ADD };
- WriteMask = RGB;
- };
-
- DepthRead = false;
- DepthWrite = false;
-
- Vertex =
- {
- uniform float invViewportWidth;
- uniform float invViewportHeight;
- uniform mat4 worldTransform;
- in vec2 bs_position;
- out gl_PerVertex
- {
- vec4 gl_Position;
- };
-
- void main()
- {
- vec4 tfrmdPos = worldTransform * vec4(bs_position, 0, 1);
-
- float tfrmdX = -1.0f + (tfrmdPos.x * invViewportWidth);
- float tfrmdY = 1.0f - (tfrmdPos.y * invViewportHeight);
- gl_Position = vec4(tfrmdX, tfrmdY, 0, 1);
- }
- };
-
- Fragment =
- {
- uniform vec4 tint;
-
- out vec4 fragColor;
- void main()
- {
- fragColor = tint;
- }
- };
- };
- };
|