Forum
Contact





DirectX using C#
DirectX using C++
DirectX using Visual Basic



Latest Forum posts

 Suggestion to change a few lines
  Posted by: Insomnica
  When: 06/09/2010 at 14:37:05

 Collision with series 1
  Posted by: radulph
  When: 05/09/2010 at 13:33:14

 HLSL calculating normals
  Posted by: miroslavign
  When: 04/09/2010 at 17:26:26

 Collision with series 1
  Posted by: ToastbrotX
  When: 04/09/2010 at 16:52:02

 HLSL calculating normals
  Posted by: Rich_Zap
  When: 04/09/2010 at 15:00:20

 Collision with series 1
  Posted by: ToastbrotX
  When: 04/09/2010 at 12:28:41

 HLSL calculating normals
  Posted by: miroslavign
  When: 04/09/2010 at 08:46:31

 Walk along a wall
  Posted by: Anonymous
  When: 03/09/2010 at 10:28:02

 model problems
  Posted by: muffinman
  When: 03/09/2010 at 06:47:32

 Vertices problem
  Posted by: Anonymous
  When: 03/09/2010 at 05:48:35

 OcTree Question
  Posted by: Zorzomezz
  When: 03/09/2010 at 04:07:03

 error x3000:syntax error
  Posted by: Anonymous
  When: 02/09/2010 at 06:55:17

 Reflection problem in corners ...
  Posted by: Anonymous
  When: 31/08/2010 at 20:53:30

 OcTree Question
  Posted by: radulph
  When: 31/08/2010 at 18:00:04

 model problems
  Posted by: Archenon
  When: 30/08/2010 at 05:54:27

 Changing computer breaks my game
  Posted by: Archenon
  When: 30/08/2010 at 05:49:50

 model problems
  Posted by: muffinman
  When: 28/08/2010 at 16:58:10

 Vertices problem
  Posted by: Anonymous
  When: 27/08/2010 at 15:35:36

 Changing computer breaks my game
  Posted by: radulph
  When: 27/08/2010 at 07:12:24

 effects file and XNA 4.0 (Beta)
  Posted by: radulph
  When: 26/08/2010 at 06:33:33




Topic: texture appearing solid



  
Goto parent category
  
Create a new user account


   texture appearing solid
 Poster : FIsherdog
 Posts: 14
 Country : USA
 City: Omaha

  
Posted by FIsherdog on 17/09/2009 at 21:13:29
OK im using the textured technique and the terrain appears as a solid color, it may be a problem with the struct so i added it here:

    
public struct VertexPositionTexture
    {
        public Vector3 Position;
        public Vector3 Normal;
        public Vector2 TextureCoordinate;

        public static int SizeInBytes = 8 * sizeof(float);
        public static VertexElement[] VertexElements = new VertexElement[]
         {
             new VertexElement( 0,0, VertexElementFormat.Vector3, VertexElementMethod.Default, VertexElementUsage.Position, 0 ),
             new VertexElement( 0, sizeof(float) * 3, VertexElementFormat.Vector3, VertexElementMethod.Default, VertexElementUsage.Normal, 0 ),
             new VertexElement( 0, sizeof(float) * 6, VertexElementFormat.Vector2, VertexElementMethod.Default, VertexElementUsage.TextureCoordinate, 0 )
         };
    }

i AM using vertex buffers and i know it isnt a problem with my texcoords

thanks riemer
BTW i ordered ur book ;)
 Poster : Archenon
 Posts: 397
 Country : Romania
 City: Oradea

  
Posted by Archenon on 18/09/2009 at 07:52:44
I cannot see anything wrong about your code for now...

Solid as what color?
white, black or one color from the texture?

Another question are you sure you are sending the texCoords from the vertexShader to the PixelShader or you leave that uninitialized (your HLSL code would be helpfull in debugging the issue)?

Cheers
 Poster : Fisherdog
 Posts: 14
 Country : USA
 City: Omaha

  
Posted by Fisherdog on 18/09/2009 at 15:16:56
indeed it was actualy a problem with the texcoords, they were being rounded to 0 or 1 because i was dividing int's the code looks like this


where H and W are the height and width of the terrain:


BEFORE:
vt[c].TextureCoordinate = new Vector2(x/W, y/H);


AFTER:
vt[c].TextureCoordinate = new Vector2((float)(x)/W, (float)(y)/H);
 Poster : Anonymous
 Posts:
 Country :
 City:

  
Posted by Anonymous on 18/08/2010 at 06:12:39
WXICAc  <a href="http://xusgktvvjvkj.com/">xusgktvvjvkj</a>, [url=http://zdatvbhlrhch.com/]zdatvbhlrhch[/url], [link=http://ohmuuyzamugh.com/]ohmuuyzamugh[/link], http://driyitffxaoa.com/

  
Post a new reply
 





Google
 
Web www.riemers.net
If you appreciate the amount of time I spend creating and updating
these pages, feel free to donate -- any amount is welcome !
- Website design & DirectX code : Riemer Grootjans -
©2006 Riemer Grootjans


News
Home
Forum
XNA 2.0 Recipes Book (8)
XNA 3.0 Recipes Book (8)
Downloads
Extra Reading (3)
Matrices: geometrical
Matrix Mathematics
Homogenous matrices
Community Projects (1)
Tutorials (160)
XNA 3.0 using C# (89)
DirectX using C# (54)
Series 1:Terrain (14)
Opening a window
Linking to the Device
Drawing a triangle
Camera
Rotation - Translation
Indices
Terrain creation
Terrain from file
DirectInput
Importing bmp files
Colored vertices
DirectX Light basics
Mesh creation
Mesh lighting
Series 2: Flightsim (19)
Series 3: HLSL (19)
Short Tuts (2)
Resizing problem
Checking Device caps
DirectX using C++ (15)
DirectX using VB (2)