Skip to main content
gamedev.net
🔒 Locked

Shader question - rendermonkey

Started by Helo7777 1 reply 900+ views
Original Post
Helo7777
Helo7777
Hi all Im just trying to put a texture onto a mesh in render monkey and im getting this result: The texture is sopose to be a rock wall texture. Heres the code: //////////////////////////////////// float4x4 matViewProjection; struct VS_OUTPUT { float4 Position : POSITION; float2 Txr1 : TEXCOORD0; }; VS_OUTPUT vs_main( float4 inPos : POSITION, float2 Txr1 : TEXCOORD0 ) { VS_OUTPUT Output; Output.Position = mul( inPos, matViewProjection ); Output.Txr1 = Txr1; return( Output ); } sampler Texture0; float4 ps_main( float4 inDiffuse: COLOR0, float2 inTxr1: TEXCOORD0 ) : COLOR0 { // Output the color taken from our texture return tex2D(Texture0,inTxr1); } /////////////////////////////////////////// Thanks for any help.
deathkrush
deathkrush
Looks like texturing is working, but all the samples are taken from one texel. Make sure that UVs for the teapot are calculated and passed in correctly to the vertex shader.
deathkrushPS3/Xbox360 Graphics Programmer, Mass Media.Completed Projects: Stuntman Ignition (PS3), Saints Row 2 (PS3), Darksiders(PS3, 360)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.