#### Archived

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

# 20 bucks if know where my lighting went.

This topic is 5854 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

• 33
• 12
• 10
• 9
• 9
• ### Forum Statistics

• Total Topics
631352
• Total Posts
2999484
×