Skip to main content
gamedev.net
🔒 Locked

glBlendFunc!

Started by golgoth Dec 22, 2004 at 10:42 AM 6 replies 1.3k views
Original Post
golgoth
golgoth
hi all! i m trying different combination to blend normal map passes between them since a while... after undreds of rebuild i m going nuts.... this glBlendFunc does not make any sense to me... is there any references on what does what with this function beside http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/blendfunc.html? THX
_the_phantom_
_the_phantom_
the red book might be slightly clearer, however thats the best you are likely to get and even that will require that, if simply playing around doesnt give the right results, you sit down and work out the maths behind it all with respect to incoming fragments and how they are blended with the fragments in the framebuffer already under different blend modes.

Its not really that hard, I did it a few months back to clear up my understanding of it all.
ZedFx
ZedFx
This is the microsoft scope on this, but it applies across all platforms, and is in the platform sdk help.

clicky
golgoth
golgoth
This is the microsoft scope on this, but it applies across all platforms, and is in the platform sdk help.

I m not what your are talking about, can you be more precise please?

what platform sdk?
golgoth
golgoth
you sit down and work out the maths behind it all with respect to incoming fragments and how they are blended with the fragments in the framebuffer already under different blend modes.

well the math remains hocus pocus yet... my problem seams pretty simple i ll try to explain maybe you can see much clearer:

my rendering pipepline draw all meshes starting with per pixel lights:

for the first draw i use no blending at all and then

glBlendFunc(GL_ONE, GL_ONE);

for all the others light...

then for each light i draw on top of everything one normal map for each light...

for the first normal map it goes with

glBlendFunc(GL_ZERO, GL_SRC_COLOR);


and there i am ... all the next normal map pass does not make sens after that... i m still wondering what combination i need to make it work properly!

I need to substract the previous normal map by the current and still keep the color of the lights! how could we do that? impossible?

any ideas?
zedzeek
zedzeek
heres an win32 app that i wrote a while ago it does the math behind it, IIRC i wrote it with FLTK so u might need that on your system
http://uk.geocities.com/sloppyturds/stuff/opengl_blending.zip
golgoth
golgoth
thx but...

Sorry, this site is temporarily unavailable!
ZedFx
ZedFx
Quote:
This is the microsoft scope on this, but it applies across all platforms, and is in the platform sdk help.

I m not what your are talking about, can you be more precise please?

what platform sdk?


The platform sdk is a Software Development Kit made by microsoft for developing for Windows 95 / 98 / Me / NT / 2000 / XP, it is freely downloadable from the microsoft website.

did you click on the link for the info on glblendfunc ? here it is again http://msdn.microsoft.com/library/default.asp?url=/library/en-us/opengl/glfunc01_4vs3.asp

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.