Monday, February 27, 2012

Andrew Harmon - Weekly Report #4

This week I've been working on attempting to combine textures with lighting. The first step is to send the texture coordinates from the model into the shader. Within the shader the vertex input will be the color, position, and world normal. The vertex output will be the same. They should look like this...

struct VertexShaderOutput
{
float4 Position : POSITION;
float3 WorldPosition : TEXCOORD0;
float3 worldNormal : TEXCOORD1;
float4 Color : COLOR0;
};

struct PixelShaderInput
{
float4 Color: COLOR0;
float3 Position: TEXCOORD0;
float3 worldNormal : TEXCOORD1;
};


In the pixel shader the texture coordinates will be added to the lighting to create the look of a texture in a naturally lit environment. Here's a link that I found helpful. http://digitseven.com/texturing.aspx

No comments:

Post a Comment