Jump to content
  • Advertisement

Yoyoyoyo

Member
  • Content Count

    62
  • Joined

  • Last visited

Community Reputation

121 Neutral

About Yoyoyoyo

  • Rank
    Member
  1. Yoyoyoyo

    Does my shader code look alright?

    Yeah it's redundant isn't it? I should remove the colour since it's not needed, but will it cause problems? It looks like the code is ok? Thank's for the feedback.
  2. Yoyoyoyo

    Does my shader code look alright?

    I've used those semantics before no prob, afaik as long as the input layout matches it's good to go.
  3. Yoyoyoyo

    Does my shader code look alright?

    My vertices contain position, colour and tex information. I have 1 constant buffer keeping track of world/view/proj, and that's about it. I am drawing a grid of vertices and expecting to see them, which i don't. I didn't think the problem was with my structs and functions here, so i just wanted a second opinion. From this code would you expect a minimal amount of vertices of type Pos/Col/Tex to be transformed correctly, and passed successfully through the vertex and pixel shader?
  4. [source lang="cpp"]cbuffer cbPerObject { float4x4 gWorldViewProj; }; Texture2D CubesTexture; SamplerState CubesTexSamplerState; ///////////////////////////// struct VS_inputVPCT { float3 Pos : POSITION; float4 Col : COLOUR; float2 Tex : TEXTURE; }; struct VS_outputVPCT { float4 Pos : SV_POSITION; float4 Col : COLOUR; float2 Tex : TEXTURE; }; struct PS_outputVPCT { float4 Col : COLOUR; float2 Tex : TEXTURE; }; /////////////////////////////// //////////////////////////////////////////////////// VS_outputVPCT VSfuncVPCT(VS_inputVPCT input) { VS_outputVPCT output; output.Pos = mul(float4(input.Pos, 1.0f), gWorldViewProj); output.Col = input.Col; output.Tex = input.Tex; return output; } PS_outputVPCT PSfuncVPCT(VS_outputVPCT input) : SV_Target { PS_outputVPCT output; output.Col = input.Col; output.Tex = CubesTexture.Sample(CubesTexSamplerState, input.Tex); return output; } ///////////////////////////////////////////////////////////////[/source] Thankyou for any assistance!
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!