GLTools

toneburst's picture

Any chance of adding a 'Subtract' blend-type to the list of blend modes added to billboards etc.? I only ask because I have a specific use for it, and, having already added the new 'Alpha' mode, I imagine it's probably not too hard for you to add other modes, too.

a|x

cwright's picture
blend equation

This is possible using the BlendEquation patch in GLTools -- OpenGL doesn't really provide a subtractive blend mode with glBlendFunc (it might be possible, but it wouldn't play nicely with alpha I think).

There's a sample composition in the source code package that demonstrates subtractive blending using this patch.

(smokris yelled at me and threatened violence if gltools 1.0 didn't have a subtractive blend solution, so you're not alone... :)

toneburst's picture
I sheeee

I'm interested in it because I came across an interesting way of doing sub-surface scattering, by rendering a depth-map of the front faces of the mesh, subtracted from the back faces, to get an approximate depth-map for the mesh. I got the idea from here http://mikepan.homeip.net/sss (the same site where I found a similar technique for doing a cheap fake SSAO).

I'm hoping it might be used somehow to make a more accurate version of the fake SSS shader I've been working on http://machinesdontcare.wordpress.com/2008/10/29/subsurface-scatter-shader/ based on a GLSL version of InvalidPointer's shader http://www.gamedev.net/community/forums/topic.asp?topic_id=481494

a|x

toneburst's picture
GL Tools Bug

I've just discovered a bug in the implementation of the new Alpha blend mode. It's not a biggie, but might be worth fixing.

To reproduce the bug, try right-clicking on a renderer patch, and choose to create a splitter for the Blending parameter. You'll get a Splitter of type Index, with the usual blending modes in the lower indices, then several thousand indices named 'Alpha'.

a|x

cwright's picture
interesting

woah, nice find. works for me too (though I only get maybe 10-12 alphas, not thousands). This is likely a QC bug actually (well, not really a bug, since we're modifying inputs and stuff, but the code that generates the list is in QC, not from us), so it might end up being much more difficult to fix...