Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- matrix orthoProjMatrix;
- float4 elementSize;
- float4 strokeWidth;
- struct VertexShaderInput
- {
- float3 position : POSITION0;
- float4 color : COLOR0;
- float2 texCoord : TEXCOORD0;
- };
- struct PixelShaderInput
- {
- float4 position : POSITION0;
- float2 texCoord : TEXCOORD0;
- float4 color : TEXCOORD1;
- };
- void VertexMain(in VertexShaderInput vsInput, out PixelShaderInput output)
- {
- output = (PixelShaderInput)0;
- output.position = mul(float4(vsInput.position, 1), orthoProjMatrix);
- output.texCoord = vsInput.texCoord;
- output.color = vsInput.color;
- }
- void PixelMain(in PixelShaderInput input, out float4 color : COLOR0)
- {
- float texStepSizeX = strokeWidth.x / elementSize.x;
- float texStepSizeY = strokeWidth.x / elementSize.y;
- float2 tex = input.texCoord;
- if(tex.x <= texStepSizeX || tex.y <= texStepSizeY || (1.0f - tex.x) <= texStepSizeX || (1.0f - tex.y) <= texStepSizeY)
- color = input.color;
- else
- color = float4(0, 0, 0, 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment