Here's a small shader I found that was in GLSL, and I thought it was pretty neat. So I ported it to Cg, modified it a little, boom - it worked Well, I didn't make the fantastic scene, but I do plan to A few simple scene, the shader, script, and material are all setup and ready to be used. Currently the wave frequency and amplitude are adjustable. In the shader, I have commented out the noise portion, but have put comments in if you wish to add it. I hope someone find a good use for this
Well the pic is tiny and clicking on it links to a blank white page So I'll trust it looks great-well done modifying shaders AC EDIT Oh wait its working now along with its lovely ads. looks like I won something. I hate those ads. Shader looks good though. Is the ripple animated? If someone reads this in 6months, will image shack still have those pictures? It would be good if this thread made sense to future readers.
Nice shader would this be something for an Ocean wave shader? . it's nice to have an animated wave loop in it, or random wave generator (perlin noise) norby
Could you post a webplayer with this ? It so much nicer to see shaders in action rather then a screenshot. Tnx
This is animated, but can be paused (depending if in the shader you use the built in _Time uniform variable). Here's a web player of what I've got currently got. Use the up and down arrows to adjust the wave frequency, and the left and right arrows for the amplitude. I tried this on the built in Water, and it seems to work, but I'd need to add a different texture (or somehow combine two like they do in the original Water shader) and add some type of transparency. Neither of things I'm 100% sure of how to do, but I should be able to figure it out. I should note that the actual vertices of the mesh stay intact, they aren't moved at all. It's all done in the fragment shader. Would a (sin wave) vertex variant be nice to have also?
Here's what it might look like if you were to use it for water. (Sorry for the ugly scene, I'm slowly improving it )
Hi Bronx i have tried the web player, i must say it looks great. can you put some randomness in the formula?. a little bit of noise instead of a sinus would be cool. Norby
Shader will be posted soon Attached is a webplayer of shader with some noise added. It's a different scene (water), because with the noise the sphere looks flat The shader and a basic scene will be released today. Just need to clean a few things up.
Yesss , great work. this is fun. what if you initiate 2 sources of noise crossing each-other . and then use this shader on a plane with a mesh deformer script to create more Amplitude.javascript:emoticon('') norby
Yesss , great work. this is fun. what if you initiate 2 sources of noise crossing each-other . and then use this shader on a plane with a mesh deformer script to create more Amplitude.javascript:emoticon('') norby
I'm not sure if that's possible, since all the work is done on the fragment shader, and at it's core it just does some fancy math to produce a new texture coordinate. If it is possible, I don't know how to (yet)
never mind. i am not a coder, that's why i am always exited when somebody creates new stuff. looking for a way to create realistic ocean waves. will you post it on wiki ? thanks for your work. Norby