arnau at April 3rd, 2004 17:23 — #1
In my application (written in C# and Managed direct X9 I have drawn several rectangles with some textures, using
TransformedTextures vertices. In my card, everything works fine, the
textures are ok.
But I've executed the application in another computer, with the same
directory tree, and the textures don't appear.
My card is a ATI Radeon 9600 and the other one is a Radeon 7500.
The rectangles appear solid, painted with different colours, although the
textures that apply to meshes or cubes with positionTextured vertices appear
Does anybody know why does this happen? Maybe any presentParams of the
Thanks in advance,
bladder at April 3rd, 2004 22:16 — #2
you might be using certain capabilities that other cards dont support. Maybe you are gorgetting some render states or texture states.
Could you paste some relevant code?
arnau at April 5th, 2004 09:53 — #3
Well, I'm not using anything strange... I've disabled all the rendering that doesn't have anything to do with the rectangle drawing, and the code left is this:
//Initialization of the device
presentParams.Windowed = true;
presentParams.BackBufferWidth = 800;
presentParams.BackBufferHeight = 600;
presentParams.BackBufferFormat = Format.X8R8G8B8; presentParams.FullScreenRefreshRateInHz = 0; presentParams.PresentationInterval = PresentInterval.Immediate;
presentParams.DeviceWindow = formPrincipal;
presentParams.SwapEffect = SwapEffect.Copy;
presentParams.EnableAutoDepthStencil = true;
presentParams.AutoDepthStencilFormat = DepthFormat.D24S8;
// Create the D3DDevice
Device3D = new Device(0, DeviceType.Hardware, formPrincipal,
Device3D.DeviceReset += new System.EventHandler(OnResetDevice);
Device3D.RenderState.Ambient = Color.FromArgb(0x40, 0x40, 0x40);
Device3D.RenderState.ZBufferEnable = true;
Then, when rendering the vertices:
//Loading the vertices
vertexBuffer.SetData(vertexData, 0, 0);
Device3D.SetStreamSource( 0, vertexBuffer, 0 );
Device3D.VertexFormat = CustomVertex.TransformedTextured.Format;
// Set the texture
Device3D.SetTexture(0, texturaFons );
// Render the face
Device3D.DrawPrimitives( PrimitiveType.TriangleStrip, 0, 2 );
And there's nothing more!
bladder at April 6th, 2004 03:59 — #4
have you tried setting texture states?
device.TextureState.ColorOperation = TextureOperation.SelectArg1;
device.TextureState.ColorArgument1 = TextureArgument.TextureColor;
The above tells d3d to take the color from the texture. From the looks of your problem, it seems that the color is being taken from the vertices (ie: diffuse). Try the above.
Also if that dosnt work, try running the debugger on the other PC and see if d3d gives you any warnings or errors at runtime.
arnau at April 7th, 2004 10:01 — #5
In another forum have answered the question.
The problem was that I forgot to add the vertex.Rhw = 1.0f; in each vertex.
Thanks for your help!
anubis at April 7th, 2004 10:57 — #6
thank you very much for posting your solution here for others