Water Shader and ps 3.0

Users who are viewing this thread

Status
Not open for further replies.

MrOcelot

Recruit
Hello. Recently I started to learn the language and to write new HLSL shaders for Warband. I have successfully adapted the Parallax Occlusion Mapping and Parallax Mapping, even though it cost me a lot of time and effort. Then I decided to do something new, such as manipulation of the vertex shader in the water. I decided to implement this by changing the Z coordinates relative to the normal map, transmitted through the shader function tex2Dlod, of course. As a sample shader I used a technique watermap, which uses vs_main_water and ps_main_water. So here's the problem: reading from a texture in vertex shader support, as far as I know, only in VS 3.0 + versions. But when I tried to change the version of the vertex shader in technique at 3.0, the shader in the game stopped working and disappear. The same situation occurs if you change the version of the pixel shader. What's the problem?
 
I solved problem by myself. Here is an image of water, animated by vertex displacement:
Water.gif
 
MrOcelot said:
I solved problem by myself. Here is an image of water, animated by vertex displacement:
Water.gif

Very nice! So many good shader tweaks coming out these days (what a time to be alive!)

How would you reckon this would effect performance on maps with large bodies of water/use of the ocean terrain border?
 
Parrot said:
How would you reckon this would effect performance on maps with large bodies of water/use of the ocean terrain border?
Of course it will affect on performance, like any other vertex animations. But we can restrict distance of animation rendering and save alot of GPU time.
By the way, if you want to see parallax occlusion mapping, i can share with you some screenshots:
With POM
d5f3893ffb8b7b5d59176561f3690e94.jpg
Without POM
e4cf9ce55816d3a687c5a11d6bf87146.jpg

With POM
10f18b37352ba19733d96415ef971e57.jpg
Without POM
a3ef20d6d920505fa7ff3b2fb06b3333.jpg

With POM
911fe8039385d56f07e1e6aaa829ea8a.jpg
Without POM
cb7d12a82989211e56b2cdb152b5599e.jpg
 
Man, this is great. Couldn't have had a better first post  :smile:

If you're planning on releasing this, it might be a good idea to change the normalmaps of some of the wall materials. Some of the walls have really strong normalmaps while others are hardly visible. The parallax mapping is already starting to distort the texture in the second set of images.
 
I can post the code, but POM has its drawbacks, and I have not yet completed the shader completely. In some places, where the texture is used inside, POM is not working properly and becomes a pixel porridge. Just have a problem with lighting. Have to sacrifice either solar shading or light sources.
 
Status
Not open for further replies.
Back
Top Bottom