Jump to content
  • Advertisement
Sign in to follow this  
SilverLogic

Blending only black...

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

Quote:
Original post by SilverLogic
No it doesnt work, first off, the image im using isnt a square image, and second, im using sdl, so i cant modify the pixel data like ordinary, so thats kinda useless to me, i said in my first post i couldnt modify the pixel data :/. thx for the attempt tho


did you even look at the code?
it gets the image data from theOpenGL Driver, ie. nothing to do with the source file or SDL.

it should work. also, its trivial to make it work with non power of two textures, just use your brain :)

PS. im assuming you missed the call to glGetTexImage in my snippet.

Share this post


Link to post
Share on other sites
Advertisement
i did look at it, in fact i implemented it into my code, and i did fix the power of 2 part by making it width and height, but the way the pixel data is stored i cannot pass it to the function

thx guys, but i fixed my problem i gave in and used masks (didnt want to cuz im gonna be using alot of images and changing them frequently thats why i didnt want them)

Share this post


Link to post
Share on other sites
i think no need to use mask. did you use to try enable alpha test? func: gl_greater would fix the problem too...

Share this post


Link to post
Share on other sites
try this:

glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0);

//{
// draw hud
//}

glDisable(GL_ALPHA);
glDisable(GL_BLEND);

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by SilverLogic
i did look at it, in fact i implemented it into my code, and i did fix the power of 2 part by making it width and height, but the way the pixel data is stored i cannot pass it to the function

thx guys, but i fixed my problem i gave in and used masks (didnt want to cuz im gonna be using alot of images and changing them frequently thats why i didnt want them)


sounds like he's just plain too lazy to figure it out.
glGetTexImage retunrns identical data format as glReadPixels, which i use to create TGA screenshot files, so its obviously not hard to read or write.

Share this post


Link to post
Share on other sites
No, not lazy..limited, like i said already, i was using sdl which has a wierd format for storing pixels and i cant find a good resource on using it properly, from what i know its just bgr instead of rgb, but i cant figure out how to modify the data or anything, i know its surface->pixels but i get errors everytime i touch them, and if i use a type definition it goes haywire, dont worry bout it though, im dropping sdl and rewriting from the ground up, thx for the help

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!