Problem with Particles, all red? arent changing color and texture not loading?

Started by
24 comments, last by xsirxx 20 years, 1 month ago
Hmm... I''ve actually had similar behavior with a game I''ve been working on...

I''ve been using DX9, but I notice that sometimes when I use meshes loaded from ''D3DXLoadMeshFromX,'' my textures on my manually defined objects become all red. It''s actually kind of funny to watch.. I represent these spaceships with little manually defined Cubes with a dice texture. When they fire "bullets," which are little cylinders loaded in from an outside source, all the Cubes on screen turn red. When the bullet goes off screen, then all the cubes get their textures back. Does anyone know where the Red comes from? Does D3D default to Red when there''s a texture error?
...
Advertisement
Coder, Ive sent that code to ya, please tell me what ya think...Ohh as far as the color changing, its taking the color off of your last loaded Material. I figured that one out and was able to easily fix that... only problem is texture wont load and setting the sprite color will not change anything without the texture working heh, oh pointsize is not working either currently, atleast not with setting it manually by a change state. Id like to keep those state changes down(like most do.) I think my texture is backwards i pressume. Im working with the tex coords to figure it out.

--err no Texcoords, but actualy face, working with the projection matrix, any look at that section and see whats wrong?

[edited by - xsirxx on March 2, 2004 4:37:55 PM]
--X
quote:Original post by xsirxx
Coder, Ive sent that code to ya, please tell me what ya think...

I don''t know what to say...I''ve not received anything yet. Sometimes the gawab.com mail server blocks people for no obvious reason. I''ll send you a mail from my other ( @ optimize-eg.com) mail instead, so please reply to it with the code.

Sorry for the inconvenience,

Muhammad Haggag
Bitwise account: MHaggag -

Ahh i sent that along.... u should have it now if not just post again heh, thnx.
--X
I don''t remember exactly what the problems where, and I can''t read the whole post right now, so I''ll post about what I found, and you tell me if that''s not the problem, ok? (Man, I do sound like an idiot )

- In the file ParticleEmitter.cpp line 41: You set the rgb values of your material to 50,50,50. This is crazy!
RGB values for materials naturally range from 0 (black) to 1 (white), when they get greater, it causes things to be *very* white. Set them to 1,1,1 instead.

- In the file Particle.cpp, line 33: You set the point-size to 700. The max point-size supported by most cards is 256 (radeons). GeForce4+ (as far as I recall) supports a max size of 8 thousand and something (practically, a couple of sprites that size would bring the GeForce down to its knees because of fill-rate consumption).

Set it to something reasonable, like 5.

Doing the above, I got this:
Note-1: Your rain texture isn''t good. It doesn''t contain alpha either, it seems
Note-2: The image has been re-scaled


And while we''re on it, you''ve got loads of memory leaks, ~500 KB. You should use smart COM pointers. I''ll come back with more details later (and other comments on the code), God-willing, Ok? (I apologize again for this, it''s just that I''m in a middle of some sort of a death march)

Muhammad Haggag
Bitwise account: MHaggag -

Yea im not keen on materials yet, that was just a couple of temp lines that actually change the color to say blue or red.... U r very correct on the settings though heh, did not know that.

s far as taht 700 for point size went, i was testing if I could set it to anything... because NOTHING was changing the size there.

So the problems r, the texture wont load correctly and the poitn sprites dont change color or size... ill see if I can load another texture with an alpha channel, but I dont even care about the alpha cahnnel right now, i just want to get the texture loaded.

Smart com? please explain more, Ill try to figure out where the memory leaks r as well. Thanks very much.

--X
--X

This topic is closed to new replies.

Advertisement