Jump to content
  • Advertisement


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


Problems with materials in DX8

This topic is 5826 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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

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

My S(h)ite

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!