Recent Forum Posts
From categories:

I am more than pleased that you find this wiki page useful, you are very welcome!

Thank you for your comments and impovements, your video looks great!

Habib

Re: Thank you! by HabibsHabibs, 24 Apr 2011 00:22

I just wanted to say thank you for this wonderful source of information!

I am using the lake shader and found it perfect for my needs. I made a few very small and trivial adjustments for my use case:

Instead of using a fixed lightSourceDir, I've added a variable for that so that the position of the sun can be changed:

float3 SunPosition;

And at the specular highlights part:
// previously:  float3 lightSourceDir = normalize(float3(0.1f,0.6f,0.5f));
float3 lightSourceDir = normalize(SunPosition);
float3 halfvec = normalize(eyeVector+lightSourceDir+float3(perturbation.x*specPerturb,perturbation.y*specPerturb,0));

I also needed to make a small change since I didn't want the water to be at the origin. So I added another float3 variable "float3 xWaterPos;" and inserted it in the line that calculated the eyeVector:

float3 eyeVector = normalize(xCamPos - xWaterPos - PSIn.Position3D);

This last part makes sure the reflections and specular highlights are placed correctly.

The result can be seen in this video: http://www.youtube.com/watch?v=l4gK-T_KxdM

Thanks again and kind regards from Belgium,
Davy

Thank you! by Flyboy3500Flyboy3500, 23 Apr 2011 20:27

The first idea I can think about right now would be similar to foam generation.

The basic way is using a foam texture that is mixed into the final color of the water surface depending on other parameters. This is usually done by the pixel shader, and you can set what should the amount of foam/algae depend on, for example: time, position or the height of the water level (if it is based on a height-field).

A little bit more detailed description of the method:
http://habib.wikidot.com/techniques#foam

Dear Habib,

Do you know of any suggestion/way to make algae grow on the surface over a given time?

Thx,
Shine

IMHO this page should be divided into multiple smaller ones to help to gain better understanding.

Update required by HabibsHabibs, 21 Jul 2009 13:21
Test post
HabibsHabibs 20 Jul 2009 19:56
in discussion General threads / Per page discussions » Shaders

This is a Test post

Test post by HabibsHabibs, 20 Jul 2009 19:56
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License