Texturing

Started by
5 comments, last by mofoj0e 20 years, 11 months ago
Hi, I'm writing a simple windmill assignment for my class. When i try to texture my windmill, the color of the texture is blue instead of the color of the picture, white(using .bmp). I've enable and disable(GL_TEXTURE_2D) everytime i begin and end my texture bindings. I know the details are very little but i dont know what else to add so you guys could help. Any clues? [edited by - mofoj0e on May 2, 2003 7:46:06 PM]
Advertisement
have u tried resetting the color value to maybe white?
use

glColor3f(1.0f,1.0f,1.0f); // Full Strength colours (ie. no tint/fade)

what it does (and I could be wrong) is multiply the colour in the texture by the above colour percent.. so 1,1,1 is full strength, and .5,.5,.5 is halfbright, aswell as you can boost the red and lower the green (or whatever else takes your fancy.


[edited by - jumpman on May 2, 2003 11:33:28 PM]
I once had the same error, and that was because my texture wasn''t 128*128 or 256*256. I dont know if this is your problem though...
Your memory is like cheese. It's full of holes, and most of it stinks
Hi guys,

Thanks for your inputs guys. The glColor3f did it. I also have another problem..

When I load the textures:

UINT g_Texture[10];

// **NEW** TEXTURES LOADING AREA(from digiben''s tutorial)
////////////////////////////////////////////////////////////
CreateTexture(&g_Texture[0], "grass.bmp", 0);
CreateTexture(&g_Texture[1], "shingles.bmp", 1);

When I''m using the grass texture:
"glBindTexture(GL_TEXTURE_2D, g_Texture[0]);"

it was fine, but when i was trying to use the shingle texture:
glBindTexture(GL_TEXTURE_2D, g_Texture[1]);
glBegin(GL_QUADS);
....

glEnd();
Then nothing shows up.

but when I use "glBindTexture(GL_TEXTURE_2D, g_Texture[2]);"
it works fine.

I''m thinking it''s the size of the texture that''s the problem but im not sure. I hope it''s not too confusing.

mofoj0e




if you used the loading code from nehe Ipicture then it will ensure that all your textures are of mod 2 (so you can load anything and it will auto-correct it for you..)

offcourse you should be able to tell if your shingles.bmp is the correct size..

i''ve not seen the CreateTexture function but shouldn''t the last parameter be 0 ?? ie..

CreateTexture(&g_Texture[1], "shingles.bmp", 0);

as you are already specifing a different Texture ID pointer.

actually on a related note.. I just sent off my texture loading functions which will auto load TGA, BMP, JPG, GIF from the same interface and handles all the alpha conversions to Nehe..
Wow, thanks alot. I didnt even look back at the createTexture function since i didnt write it, but you''re absolutely correct.

This topic is closed to new replies.

Advertisement