Archived

This topic is now archived and is closed to further replies.

ByteMe95

Problems with materials in DX8

Recommended Posts

I''m trying to use materials in DX8 but for some reason they are just having no effect whatsoever. Im trynig a test material with the diffuse/ambient values set to some random color/alpha value, and I do SetMaterial before calling drawprim (i tried other variations, before/after settexture, etc) but it seems to have no affect on the prims being rendered at all. My prims are all textured, the FVF I am using at first had xyz | difuse | tex_1, but i thought havign diffuse might have been the problem, so I took out the diffuse and it still doesnt work in either case. This is for a 2d in 3d game, it uses an ortho projection, and there are no lights and lighting is not enabled. Ive had a similar problem a year and a half ago using materials but I really have no idea how I solved it last time ByteMe95::~ByteMe95() My S(h)ite

Share this post


Link to post
Share on other sites
Materials are used by the D3D lighting pipeline, nowhere else. If you aren''t using D3D lights (since your FVF has a diffuse colour and no normals I''d say you aren''t), then materials have no effect.

Maybe when you solved the problem last time you were using the MATERIALSOURCE renderstates with lighting enabled. In that case, the things set in MATERIALSOURCE override the usual parts of the D3D lighting pipe.

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
hmm, i was looking through those materialrender states, dont really see what I would set them as. I do want the material itself to control the color of the primitives being drawn with it, I will take the diffuse component out of my FVF. But I will not have an lights, I can always enable lighting I suppose.

Still dont know what to do
- Rob

ByteMe95::~ByteMe95()
My S(h)ite

Share this post


Link to post
Share on other sites