   Planets not rendering on ATI Cards
  I've been banging my head on this for weeks now, I'm having issues rendering some simple planets I've created on ATI cards so it seems. Everything works fine on Nvidia cards so far, I've yet to have any issues. I've tried using a couple of the different rendering calls for rendering the planets, such as 'DrawUserIndexedPrimitives' and so on. At first I thought it was the multi threading I have set up in my main project, but this is not the case. I've built a smaller example of what I'm trying to achieve, but I'm still having trouble with rendering them on any ATI card. In the code I paste below the planets render fine on nvidia, but on the ati version you can just see a bounding sphere where a planet should be.My current custom vertex, this seems to be fine though. I think :(public struct VertexPositionNormalUpRightTexture{    public Vector3 Position;    public Vector3 Normal;    public Vector3 Up;    public Vector3 Right;    public Vector2 Texture;    public static int SizeInBytes = (3 + 3 + 3 + 3 + 2) * 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.Vector3, VertexElementMethod.Default, VertexElementUsage.Position, 1),   new VertexElement(0, sizeof(float) * 9, VertexElementFormat.Vector3, VertexElementMethod.Default, VertexElementUsage.Position, 2),   new VertexElement(0, sizeof(float) * 12, VertexElementFormat.Vector2, VertexElementMethod.Default, VertexElementUsage.TextureCoordinate, 0),    };}This is where I generate my sphere but I don't think this would be the issue, unless ATI don't like the way the indices are laid out, or something in the lines of that.public void CreateSphere(ref VertexPositionNormalUpRightTexture[] vpnt, ref int[] indices, int m_NumSlices, int m_NumStacks, float m_Radius){    int tDiv = m_NumSlices;    int pDiv = m_NumStacks;    float dt = ((float)Math.PI * 2) / tDiv;    float dp = (float)Math.PI / pDiv;    int vertex = 0;    for (int pi = 0; pi <= pDiv; pi++)    {   float phi = pi * dp;   for (int ti = 0; ti <= tDiv; ti++)   {  // we want to start the mesh on the x axis  float theta = ti * dt;  vpnt[vertex].Position = GetPosition(theta, phi, m_Radius);  vpnt[vertex].Normal = GetNormal(theta, phi);  vpnt[vertex].Texture = GetTextureCoordinate(theta, phi);  vertex++;   }    }    int index = 0;    for (int pi = 0; pi < pDiv; pi++)    {   for (int ti = 0; ti < tDiv; ti++)   {  int x0 = ti;  int x1 = (ti + 1);  int y0 = pi * (tDiv + 1);  int y1 = (pi + 1) * (tDiv + 1);  indices[index] = x0 + y0;  indices[index + 1] = x0 + y1;  indices[index + 2] = x1 + y0;  indices[index + 3] = x1 + y0;  indices[index + 4] = x0 + y1;  indices[index + 5] = x1 + y1;  index += 6;   }    }    for (int i = 0; i < vertex; i++)    {   Vector3.Normalize(ref vpnt.Position, out vpnt.Normal);   vpnt.Up = new Vector3(0, 1, 0);   if (Math.Acos(Vector3.Dot(vpnt.Up, vpnt.Normal)) < 0.1f)   {  vpnt.Up = new Vector3(0, 0, 1);   }   if (Math.Acos(Vector3.Dot(-vpnt.Up, vpnt.Normal)) < 0.1f)   {  vpnt.Up = new Vector3(0, 0, 1);   }   Vector3 cross = Vector3.Cross(vpnt.Normal, vpnt.Up);   Vector3.Normalize(ref cross, out vpnt.Right);   vpnt.Up = Vector3.Cross(vpnt.Normal, vpnt.Right);    }}One of the drawing calls I've tried drawing the planet with. This all works fine with any nvidia card I've tried, I've tried a few other draw calls as well so I'm not so sure if this would even be the problem.device.VertexDeclaration = terrainVertexDeclaration; effect.Begin(); foreach (EffectPass pass in effect.CurrentTechnique.Passes) {pass.Begin();device.DrawUserIndexedPrimitives<VertexPositionNormalUpRightTexture>(PrimitiveType.TriangleList, vpnt, 0, vpnt.Length, indices, 0, indices.Length / 3);pass.End(); } effect.End();I'm thinking maybe the shader could pose some sort of issue, maybe the way I've done something with the custom vertex ATI doesn't like, but I'm not sure.//------- Constants --------float4x4 xView;float4x4 xProjection;float4x4 xWorld;float4x4 WorldViewProj;float4x4 ViewIXf;float3 xLightDirection;//float3 CameraDirection;//float4 RimColor;//float  RimIntensity;//------- Texture Samplers --------Texture xTexture1;sampler TextureSampler1 = sampler_state { texture = <xTexture1>; magfilter = LINEAR; minfilter = LINEAR; mipfilter=LINEAR; AddressU = wrap; AddressV = wrap;};Texture xNormal1;sampler NormalSampler1 = sampler_state { texture = <xNormal1>; magfilter = LINEAR; minfilter = LINEAR; mipfilter=LINEAR; AddressU = wrap; AddressV = wrap;};//------- Technique: Textured --------struct TexVertexToPixel{    float4 Position   : POSITION0;   float4 Color: COLOR0;    float2 TextureCoords: TEXCOORD0;    float3 UP : POSITION1;    float3 RIGHT   : POSITION2;    float3 NORMAL  : NORMAL0;};struct TexPixelToFrame{    float4 Color : COLOR0;};TexVertexToPixel PlanetVS( float4 inPos : POSITION0, float3 inNormal: NORMAL0, float4 inUp : POSITION1, float4 inRight : POSITION2 ,float2 inTexCoords: TEXCOORD0){TexVertexToPixel Output = (TexVertexToPixel)0;float4x4 preViewProjection = mul (xView, xProjection);float4x4 preWorldViewProjection = mul (xWorld, preViewProjection);    Output.Position = mul(inPos, preWorldViewProjection);Output.TextureCoords = inTexCoords;Output.Color = float4(1.0f, 0.0f, 0.0f, 1.0f);    Matrix world2;    world2[0].x = xWorld[0].x;    world2[0].y = xWorld[0].y;    world2[0].z = xWorld[0].z;    world2[1].x = xWorld[1].x;    world2[1].y = xWorld[1].y;    world2[1].z = xWorld[1].z;    world2[2].x = xWorld[2].x;    world2[2].y = xWorld[2].y;    world2[2].z = xWorld[2].z;    world2[0].w = 0;  world2[1].w = 0;  world2[2].w = 0;  world2[3].x = 0;    world2[3].y = 0;    world2[3].z = 0;    world2[3].w = 1;  Output.UP = mul(inUp, world2);Output.RIGHT = mul(inRight, world2);    Output.NORMAL = mul(inNormal, world2);    return Output;}TexPixelToFrame PlanetPS(TexVertexToPixel PSIn) {TexPixelToFrame Output = (TexPixelToFrame)0;float4x4 TangentMatrix;TangentMatrix[0].x=PSIn.RIGHT.x;  TangentMatrix[0].y=PSIn.RIGHT.y;  TangentMatrix[0].z=PSIn.RIGHT.z;   TangentMatrix[0].w=0;TangentMatrix[1].x=PSIn.UP.x;TangentMatrix[1].y=PSIn.UP.y;TangentMatrix[1].z=PSIn.UP.z; TangentMatrix[1].w=0;TangentMatrix[2].x=PSIn.NORMAL.x; TangentMatrix[2].y=PSIn.NORMAL.y; TangentMatrix[2].z=PSIn.NORMAL.z;  TangentMatrix[2].w=0;TangentMatrix[3].x=0;   TangentMatrix[3].y=0;   TangentMatrix[3].z=0;    TangentMatrix[3].w=1;float3 lightdir_in_tangent_space = mul(TangentMatrix, xLightDirection);float3 nor=tex2D(NormalSampler1, float2(PSIn.TextureCoords)).rgb*2-1; float pixel_light=dot(lightdir_in_tangent_space, -nor);//float3 norm = normalize( PSIn.NORMAL );//float4 rim = pow( 1 - dot( norm, CameraDirection ), 5.0f ) * RimColor * RimIntensity;//Output.Color = rim;Output.Color.rgb = tex2D(TextureSampler1, float2(PSIn.TextureCoords)).rgb;Output.Color *= pixel_light;Output.Color.a = 1;return Output;}technique Textured{pass Pass0    {  VertexShader = compile vs_3_0 PlanetVS();   PixelShader  = compile ps_3_0 PlanetPS();    }}Heres a link to a small demo I put together, it takes a couple of seconds to open as its generating some perlin noise. It would be nice if some people could let me know some results, if they have any luck seeing these planets. There not hard to spot either, as both nvidia and ati support the bounding spheres of where they should be displaying.http://www.mediafire.com/?48r3v4gi7tq5wuzIf someone can figure out whats going on it'd be a huge help. I've been doing my head in and stripping this project down class by class to see if anything else is the problem.   
  I downloaded the zip file, launched the executable, but the program crashed on launch. I have a HD 5750 card, an i7 920 cpu, running windows 7 ultimate.   ;  Do you have XNA installed or the 3.1 redistributable for it? It's around 7mb - http://www.microsoft.com/downloads/en/details.aspx?FamilyID=53867a2a-e249-4560-8011-98eb3e799ef2   ;  Installed XNA redist and the program launched.I got a pretty image of space with a sun, and two sets of two red same concentric circles with axes aligned perpendicular to each other. It told me it had drawn 2 planets but I only saw red circles.   ;  Are you running 64 bit windows as well. I'm wondering now if thats possibly the cause some how. I want to see if someone can run it with an ATI card and 32 bit windows. Thanks for testing it out, god it's killing me though :(   ;Quote:Original post by ScottehyAre you running 64 bit windows as well. I'm wondering now if thats possibly the cause some how. I want to see if someone can run it with an ATI card and 32 bit windows. Thanks for testing it out, god it's killing me though :(As a matter of fact I am running 64 bit windows BUT, that shouldn't be the problem. 32 bit applications run fine on my system.As far knowing why it doesn't work on ATI cards I can't really say, but this is not the first time I've seen ATI fail at doing something Nvidia can. When I bought this card I couldn't even install the drivers. I had to scour the internet for possible solutions and then install an ancient MS hotfix to do so.Good luck!   ;  running a radeon 4670 agp card on 32bit winXP.  No planets.  I just get two red circles that suggest a sphere.  The debug text says 1 planet rendered when those intersecting circles are in view.   ;  Hmm, not to sure what to do. I was going to use my full version of this as one of my demos in a portfolio. Kind of a pain now as I've spent more time trying to fix this, than I have programming this procedural demo.   ;  Make sure you turn on all the d3d debug information. Nvidia in general is more forgiving when it comes to not initializing something the correct way or assigning something an invalid value.   ;  Alright, so I used a dx debugger and this is all I get when I run my game, nothing but the planets are displaying at the moment. In my mind this all seems fine. So my guess is it may be something to do with the shader then, but I really have no idea what.[460] Direct3D9: (INFO) :Direct3D9 Debug Runtime selected.[460] [460] D3D9 Helper: Enhanced D3DDebugging disabled; Application was not compiled with D3D_DEBUG_INFO [460] Direct3D9: (INFO) :======================= Hal HWVP device selected [460] [460] Direct3D9: (INFO) :HalDevice Driver style b [460] [460] Direct3D9: (INFO) :Using FF to VS converter [460] [460] Direct3D9: (INFO) :Using FF to PS converter [460] [460] Direct3D9: (INFO) :Enabling multi-processor optimizations[460] [460] Direct3D9: (INFO) :DDI threading started [460] [460] Direct3D9: (WARN) :SetVertexDeclaration: NULL declaration pointer [460] [460] Direct3D9: (INFO) :DDI threading stopped [460] [460] Direct3D9: (INFO) :Using FF to VS converter [460] [460] Direct3D9: (INFO) :Using FF to PS converter [460] [460] Direct3D9: (INFO) :DDI threading started [460] [460] Direct3D9: (INFO) :DDI threading stopped [460] [460] Direct3D9: (INFO) :MemFini!