ebiten/cmd/ebitenmonogame/shader.fx.go
2020-04-24 20:48:01 +09:00

7 lines
1.6 KiB
Go

// Code generated by file2byteslice. DO NOT EDIT.
// (gofmt is fine after generating)
package main
var shader_fx = []byte("\ufeff#if OPENGL\n #define SV_POSITION POSITION\n #define VS_SHADERMODEL vs_3_0\n #define PS_SHADERMODEL ps_3_0\n#else\n #define VS_SHADERMODEL vs_4_0_level_9_1\n #define PS_SHADERMODEL ps_4_0_level_9_1\n#endif\n\nTexture2D Texture;\nfloat2 ViewportSize;\n\nSamplerState samplerState\n{\n Texture = <Texture>;\n MinFilter = Point;\n MagFilter = Point;\n MipFilter = Point;\n AddressU = Clamp;\n AddressV = Clamp;\n};\n\nstruct VertexShaderInput\n{\n float2 Vertex : POSITION0;\n float2 TexCoord : TEXCOORD0;\n float4 TexRegion : TEXCOORD1;\n float4 Color : COLOR0;\n};\n\nstruct VertexShaderOutput\n{\n float4 Position : SV_POSITION;\n float2 TexCoord : TEXCOORD0;\n float4 Color : COLOR0;\n};\n\nVertexShaderOutput MainVS(in VertexShaderInput input)\n{\n VertexShaderOutput output = (VertexShaderOutput)0;\n\n float4x4 projectionMatrix = {\n 2.0 / ViewportSize.x, 0, 0, -1,\n 0, -2.0 / ViewportSize.y, 0, 1,\n 0, 0, 1, 0,\n 0, 0, 0, 1,\n };\n output.Position = mul(projectionMatrix, float4(input.Vertex.xy, 0, 1));\n output.TexCoord = input.TexCoord;\n output.Color = input.Color.rgba;\n\n return output;\n}\n\nfloat4 MainPS(VertexShaderOutput input) : COLOR\n{\n float4 c = tex2D(samplerState, input.TexCoord.xy).rgba;\n //float4 c = Texture.Sample(samplerState, input.TexCoord.xy);\n return c * input.Color.rgba;\n}\n\ntechnique BasicColorDrawing\n{\n pass P0\n {\n VertexShader = compile VS_SHADERMODEL MainVS();\n PixelShader = compile PS_SHADERMODEL MainPS();\n }\n};\n")