Archived

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

20 bucks if know where my lighting went.

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

Recommended Posts

20 bucks to the first person who can solve this problem. I''m currently porting my engine to use D3D. Things were going OK until I tried supporting multitextured models. The problem is this: the multitextured models are multitextured, but they''re not lit - they are equally bright on all sides. The single-textured models are lit just fine. I discovered that if I remove D3DFVF_TEX2 from set of flags I''m passing to SetVertexShader, the lighting reappears. Of course, that makes the multitexturing vanish. Does anybody have a clue what''s going on? - Josh

Share on other sites
I have no ideas what could be causing this, but a few guesses:
1) Make sure your normals are good. When you say it works with just one texture, it makes me think that this is fine.
2) Check to make sure the light was created properly. Again, since it worked with one texture, I can''t see why it wouldn''t work with 2, so this probably isn''t the problem.
3) Check to make sure your renderstates are being set correctly and that lighting isn''t being turned off for some reason when you draw the second texture.

How about posting some of the source?

Moe''s site

Share on other sites
Okay. I put the source code at this URL:

egenesis.com/bug.txt

Note that the interesting routine is at the bottom of the file.

- Josh

Dang, If I had $20 I would have bought Milkshape 3D... Moe''s site Share this post Link to post Share on other sites No... not allowed. The FVF flags are telling Direct3D what your vertex structure looks like. So if you send it the wrong vertext structure definition, things aren''t going to work. Look at the examples. Another thing you are doing wrong is that you are using D3DFVF_TEX1 | D3DFVF_TEX2. This is wrong. The D3DFVF_TEX2 flag means you have 2 sets of texture coordinate sets. Don''t use more than one TEX# flag at a time. Share this post Link to post Share on other sites I gotta go home for the day, I''ll continue looking into this tomorrow. Share this post Link to post Share on other sites Pyabo, right on target about TEX1 | TEX2. Send me your mailing address, and I''ll send you the$20. jyelon@egenesis.com

BTW, I''ve noticed that this is a recurring feature of D3D - when I make a mistake, it doesn''t return an error code. Instead, it BSODs, or it garbles the results. Is this a problem with the NVidia DirectX driver, or is it a problem with D3D in general?

- Josh

Share on other sites
Lucky, if you got garbage result. When I first was playing with multitexturing I also tried your way D3DFVF_TEX1 | D3DFVF_TEX2 in my Vertex Format and it would restart my computer :''(

Share on other sites
Lucky, if you got garbage result. When I first was playing with multitexturing I also tried D3DFVF_TEX1 | D3DFVF_TEX2 in my Vertex Format and it would restart my computer and then screw up my source file hah was definitly a fun error ...:''(

Share on other sites
Oh, don''t feel too great for me. I''ve been getting 2-3 BSODs a day since I started converting my code from OpenGL to DirectX.

- Josh

Share on other sites
quote:
Original post by Nekhmet
BTW, I''ve noticed that this is a recurring feature of D3D - when I make a mistake, it doesn''t return an error code. Instead, it BSODs, or it garbles the results. Is this a problem with the NVidia DirectX driver, or is it a problem with D3D in general?

It''s a problem with you. Check the ''DX debug mode'' thread to see what you''ve been missing.

Share on other sites
Nekhmet, save your \$20 and put it toward an MSDN subscription. All I did was a search on "D3DFVF_TEX2" and read a few blurbs about it, and then extrapolated from your original mail what you might be doing wrong... then when you posted your code that confirmed it.

As for BSODs... what operating system are you working on? This mistake in particular can easily result in an Access Violation, which on Win98/ME will often crash the computer. Even on Win2K/XP you can put the machine in an unusable state because of DirectX. Connecting to the machine remotely and being able to kill processes remotely will help a great deal.

Share on other sites
I''m using win2k.

I realized after reading some of the comments here that I wasn''t using the debug version of the driver. That may help.

- Josh