Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6822

Difficulty with matrixs passed to shaders

$
0
0

@willmotil wrote:

Ok so i have 1 of 4 problems squashed here is the second which has me totally stumped especially since i cant see whats going on in the gpu.

Whats the difference between this bit of shader code which works.

float4x4 gworldviewprojection;

VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
{
    // regular________________
    VertexShaderOutput output;
    output.Position = mul(input.Position, gworldviewprojection);
    output.Color = input.Color;
    output.TexureCoordinate = input.TexureCoordinate;
    //________________________
    return output;
}

And this which doesn't.

the matrix's appear in the xnb i would think this would work.
but i get nothing cornflower blue.

float4x4 world;
float4x4 view;
float4x4 projection;

VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
{
    // ________________
    VertexShaderOutput output;
    float4x4 vp = mul(view, projection);
    float4x4 wvp = mul(world, vp);
    output.Position = mul(input.Position, wvp);
    output.Color = input.Color;
    output.TexureCoordinate = input.TexureCoordinate;
    //________________________
    return output;
}

Posts: 5

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 6822

Trending Articles