Jump to content
  • Advertisement

Archived

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

C=64

OpenGL Problem w/OpenGL Texturing the Color Green

This topic is 6936 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''ve finally got my OpenGL-based OBJ and MD2 viewer working, but I''ve hit an odd snag. For some reason, the green component of my textures are WAY darker than they''re suppose to be. But the red and blue components are displaying just fine. At first, I considered that it might have been a bug in my texture loading code (BMPs and PCXs). However, both texture loading routines suffer from the same problem, and when I disable lighting the problem completely goes away, leaving me to believe that the neither the textures nor texture loading routines are at fault. The problem exists in both software and hardware (G400 Max) rendering, and other applications (Chumbalum''s MD2 viewer) have no problems handling the green component with lighting enabled, leaving me to believe that the OpenGL driver and my display are working properly. I''m not using any colored lighting, and untextured models are rendered in the expected gray shade, leaving me to believe the lighting settings aren''t causing this. Any ideas what I''m doing wrong? I''d appreciate any help. ---- C=64

Share this post


Link to post
Share on other sites
Advertisement
Are you remembering that in 16 bit graphics the green usually gets 6 bits? That means if you have a macro to convert RGB to an unsigned int, the G can vary twice as much as the R and B. Just a thought.

Share this post


Link to post
Share on other sites
I appreciate the help acw83. After your post, I tried my program at every color depth between 8-bit to 32-bit, and alas, the problem still exists. I''m not using any macro''for TGB conversion or anything, but I was hoping... Atleast I''ld KNOW what to fix.

As a side, while experimenting with the lighting, I discovered that the green component isn''t even being EFFECTED by the lighting! I enabled lighting, but didn''t enable any of the lights. The red and green components were black, as would be expected, but the green was still the same half intensity shade! ARGH!!!!!!

---
(a very frustrated) C=64

Share this post


Link to post
Share on other sites
Argh. Finally found the problem. After spending the last day and a half digging through all my texture loading, binding, sorting, and lighting code, I finally found the problem: A debug line I forgot to remove from when I was originally loading in MD2 models but wasn''t sure if the normals were loading properly.

I was applying a material whose effect as it turns out was enough that it ONLY effect the green component of the texture maps, AND made the green pretty darn immune to the effects of lighting. Boy, did I make a great choice !

Sigh...

---
(a very embarassed) C=64

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!