Hi Mark, On Mar 1, 2007, at 6:30 AM, Mark McKay wrote:
I've been following the thread on OpenGL fragment shaders, and am wondering how I might play around with these on my own. Can I create any arbitrary fragment shader? Gaussian blurs? Embossing? Non-tileable patterns? Animated images? Can I pass attributes to them? What about samplers? If so, fragment shaders have a lot of potential.
Yes, all of the above (and more) are do-able using fragment shaders in OpenGL. (Just to be clear, the stuff I've been doing recently involves getting Java 2D's OGL pipeline to use fragment shaders as an *implementation detail* only, e.g. speeding up existing operations such as gradient paints and various BufferedImageOps. We are not exposing any new API that would allow developers to write their own shaders for use by Java 2D, although that would be a cool enhancement for the future.)
If there is an introduction to using fragment shaders for 2D, please let me know!
If you're interested in writing fragment shaders in OpenGL, I'd highly recommend the OpenGL "Orange Book": http://www.3dshaders.com/joomla/ There are other various tutorial scattered about the internet. Romain Guy did a nice write-up recently about how to use shaders in JOGL for 2D image processing purposes (you might need to email him for the source code though, not sure why): http://www.curious-creature.org/2007/02/20/fast-image-processing-with- jogl/ Writing shaders often involves huge amounts of boilerplate code, which is frustrating for a newcomer. Therefore, we're thinking of whipping up some convenience APIs for JOGL that will make it easy for folks to start playing around with shaders without getting bogged down in the details. More on that later. Hope this helps, Chris =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".