Xor
@XorDev
Hello!
I'm trying to write a Multiple Render Target shader for our game, Xodusse, and I'm having trouble figuring out the HLSL 11 syntax. I am currently using HLSL 9, but I want to rewrite the shader for GameMaker Studio 2.
I can't find any information on the syntax so I'm kind of just guessing and I might be a bit off. Here's the vertex shader I'm attempting to use:
And here's the fragment shader that doesn't work:
Any help is appreciated! Thanks!
I'm trying to write a Multiple Render Target shader for our game, Xodusse, and I'm having trouble figuring out the HLSL 11 syntax. I am currently using HLSL 9, but I want to rewrite the shader for GameMaker Studio 2.
I can't find any information on the syntax so I'm kind of just guessing and I might be a bit off. Here's the vertex shader I'm attempting to use:
Code:
struct VertexShaderInput
{
float4 vPosition : POSITION;
float4 vColor : COLOR0;
float2 vTexcoord : TEXCOORD0;
};
struct VertexShaderOutput
{
float4 vPosition : SV_POSITION;
float4 vColor : COLOR0;
float2 vTexcoord : TEXCOORD0;
};
VertexShaderOutput main(VertexShaderInput INPUT)
{
VertexShaderOutput OUTPUT;
float4 matrixWVP = mul(gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION], INPUT.vPosition);
OUTPUT.vPosition = matrixWVP;
OUTPUT.vColor = INPUT.vColor;
OUTPUT.vTexcoord = INPUT.vTexcoord;
return OUTPUT;
}
Code:
struct PixelShaderInput{
float4 vPosition : SV_POSITION;
float4 vColor : COLOR0;
float2 vTexcoord : TEXCOORD0;
};
struct PixelShaderOutput
{
float4 vColor : COLOR0;
float4 vNorml : COLOR1;
};
PixelShaderOutput main(PixelShaderInput INPUT)
{
PixelShaderOutput OUTPUT;
float4 diffuseTexture = gm_BaseTextureObject.Sample(gm_BaseTexture, INPUT.vTexcoord);
OUTPUT.vColor = INPUT.vColor * diffuseTexture;
OUTPUT.vNorml = float4(1,0,0,1); //Just pass a red texture for this test.
return OUTPUT;
}
This code does not compile and the compile message doesn't help much:
FAILED: Run Program CompleteAny help is appreciated! Thanks!
Last edited: