PDA

View Full Version : Ocean shine - how to implement without extensions?



meanfox
02-17-2006, 05:13 PM
Hi,

Wondering if someone can guide me a bit here. I would like some nice specular highlights on my oceans but not the land. I have these bitmaps:

1. RGB Texture of Earth (land and ocean)
2. B&W RGB map of oceans (oceans white, land black) - could convert to alpha.

Any way to get the desired effect without using an extension? Hopefully just 2 renders. Maybe something like this I think:

1. Render planet without spec
2. Render map with cunning blending and spec lighting...?

Thanks for any help -

Tom

meanfox
02-26-2006, 12:48 AM
Hmmm, what happened to this forum? Where did everyone go?

dorbie
02-26-2006, 01:22 AM
Do you want code or what?

I mean do a lighting pass with specular modulated by your texture and add it to the diffuse pass with a one, one blendfunc.

You basically describe your algorithm in your question.

Maybe you should have posted in the beginners forum.

dpoon
02-26-2006, 01:37 AM
The OpenGL Shading Language book (aka the orange book) has a chapter on rendering the earth and using a specular map to control which areas are lit with specular highlights.

meanfox
02-26-2006, 02:36 PM
Well thanks. Got it working, Sometimes you just need confirmation that you're on the right path so that you know to persevere when it ain't working. You gotta squeak to get the grease, even if your tyre gets kicked :-)

Brolingstanz
02-26-2006, 10:51 PM
Yes, but there are far more people squeakin' than there are people greasin'.

Besides, you learn more by answering questions than you do by asking them. But then again, maybe I've been listening to too much Pat Boone lately.