Log in

View Full Version : [REQ] Howto assign "Bumpmap/texture" to the water


urfisch
07-25-11, 07:31 AM
I am experimenting with the water since some days now. The surface needs a better structure, to simulate the light reflection, like sh4 and sh5 do. So i tried reaching this by harden the bump controllers, or forming smaller waves. All this is not very promising so far. It looks better, but the missing light reflection is the key.

:-?

Today i tried to assign an extra bumpmap controller or a simple texture (like the foam) to the water. No success so far. So i need help, as the way i assign them seems to be the problem (game crashes when entering the bridge).

Who can help me?

:hmmm:

I work in the scene.dat, as here are all accessable parameters from the water, although the water itself seems to be defined somewhere else. I recognized not to to be able to change the minimum size of the waves. Changing the scaling options of the EnvData parameters had no effect. But adding a bumpmap controller to the EnvSim Node, or another WaterReflection Controller caused a crash in the game.

So adding a texture for the normal waves, like the game uses the foam textures for bigger waves, and adding bumpmaps to these, would give us a light reflection, right? And this is how we could raise the watereffect to a new level.

:yeah:

urfisch
07-25-11, 09:51 AM
Found the bumpmap, the water in sh4 uses. But theres simply no access to the foam files, nor to the foam controller, which manages when foam is created. Had the idea, in adding a foam with bump map to the normal sea movement (even while smaller winds). But even that was unsuccessful til now...

Interestin: The EnvSim.act file contains the mentioned controllers + additional controllers, which do not appear in the scene.dat. As so the missing foam texture controllers. But there are also no variables stored, afai can see. Disassambled the EnvSim.act and went to the 2 addresses which are connected with the foam controller. But there are not values stored.

Need help.

Anvart
07-25-11, 10:43 AM
I think, you know ...
The structure of the water surface (waves) is defined in scene.dat and in sim.cfg section [Mech] ...
Water Scale, Normal, Patches, BumpScale, Light/DarkColor, ReflIntensity, SupressWaves, ChoppyWave and so on.
Colour of water surface and reflections in the water are defined in SkyColors_***.dat... textures Sky_***.tga and reflex_***.tga.
Some colours and reflections are defined in EnvColors_***.dat...
Therefore you can change water surface parameters in scene.dat, add additional reflections object into SkyColors_***.dat and so on...
Also do not forget about [Glare] section in Effects.cfg.

urfisch
07-25-11, 11:47 AM
thank you anvart.

yes, i knew...but not about the mech in the sim.cfg, thanks for that. but the problem is differently located. please read my thread carefully. its about, how i make the foam appear on waves of smaller wind. and how do i apply a bumpmap to the foam on the waves?!

there is no normal access. the foam textures are listed in the EnvSim.act file but afai can see there is no value stored for them and i cant read/see the reference they point to, maybe. some calls go to the properties.dll...but there is no value defined...afaics.

somewhere there must be values beeing stored for this! definitely.

Wolfstriked
07-25-11, 12:45 PM
Urfisch,do not take this wrong way.I posted this in other thread and you did not respond.Try the GWX16km mod as its tweaked the water and not just moved the view further away.It looks very good to me with just some times of day the water turning baby blue.But there is a difference in how the water looks by large amount.Here are pics comparing stock GWX water to GWX16km mod.This is run at 1024x768 and this game looks even better when at 1600x1200.

http://desmond.imageshack.us/Himg807/scaled.php?server=807&filename=sh32011072513302711.jpg&res=medium

http://desmond.imageshack.us/Himg714/scaled.php?server=714&filename=sh32011072513352008.jpg&res=medium

http://desmond.imageshack.us/Himg535/scaled.php?server=535&filename=sh32011072513305410.jpg&res=medium

http://desmond.imageshack.us/Himg23/scaled.php?server=23&filename=sh32011072513353421.jpg&res=medium


http://desmond.imageshack.us/Himg231/scaled.php?server=231&filename=sh32011072513352619.jpg&res=medium

This is how my game looks like...looks really good to me with the only thing being the shadows on the water are very jaggy.I am trying to rid that though....

http://desmond.imageshack.us/Himg707/scaled.php?server=707&filename=sh32011072411563885.jpg&res=medium

http://desmond.imageshack.us/Himg146/scaled.php?server=146&filename=sh32011072411565246.jpg&res=medium
http://desmond.imageshack.us/Himg38/scaled.php?server=38&filename=sh32011072411595540.jpg&res=medium
http://desmond.imageshack.us/Himg850/scaled.php?server=850&filename=sh32011072412030500.jpg&res=medium

Hitman
07-25-11, 01:38 PM
Perhaps if the reflections of sky and clouds could be made flat bright white and broken into a myriad of small pieces it could have a similar effect to what you want :hmmm: If the reflection was just a texture, then it sure could be done, but the reflection I think is hardware.

urfisch
07-25-11, 01:45 PM
the reflections are hardware, right. therefore i wanted to override it, by using the foam-technique of the waves.

1. make a new foam texture, which material in the dat-file contains a bumpmap controller

2. make the waves using this foam, always. not only using foam, when the waves are higher.

3. get reflections by using this texture on the water, by using its bump-properties.

voila, new looking water.

BUT, as i wrote: there is no direct access to the wave/foam controllers. we need to change/add one controller, that enables the water using a new foam, that is always on top of the water. this is only possible, with help of people who are able to "read" the *.act file and know, where it gets its values from.

Anvart
07-25-11, 04:15 PM
... the foam textures are listed in the EnvSim.act file ...
Are you shure? :DL
... 1. make a new foam texture, which material in the dat-file contains a bumpmap controller
Did you find material for foam in scripted files?

2. make the waves using this foam, always. not only using foam, when the waves are higher.

3. get reflections by using this texture on the water, by using its bump-properties.

voila, new looking water.
...

Yes, the dream is not bad... :yep:

rik007
07-25-11, 10:46 PM
That controller should then overrule the reflection from the game itself. It's effect can be seen by setting GlobalReflectionIntensity to 0 in scene.dat for clouds (49 in Silent3ditor) or waveproperties (14).

urfisch
07-26-11, 05:48 AM
@anvart

yes, i think its the only way for us to get a water, finally looking similar to sh4 or sh5 water. it will not be the same, nice and real looking one. but it would be much more better, than all the existing mods for the water!

i dont know, if they are "stored" in it, i think no. but the controllers for the foam texture layers are defined there. but the values and the call for the texture files must be somewhere else. havent found it.

its quite time expensive and since i tried to use a hires mod, my sh3 only says "cannot initialize 3d engine" even i deleted all files and changed everything to normal state...i always have to use the display changer to get it started now. disturbing ****...

:down:

@rik
would not be clever to make it overriding the existing controllers. but a bumpmap addition for the water would give us these small light reflections, which make the water of sh4 and sh5 that nice. there is already a bumpmap for this in sh4 stored. we "just" need to get the water generator use it.

Hans Witteman
07-26-11, 06:24 AM
Hi mate,

What have you done to me after your thread the idea was haunting me and i did a full night of testing and i know exactly the effect you are after regarding faking the reflection since we lack of a modern shader model.

So i fiddle again with the reflex atlantic.tga and did a noise map to get the smallest possible speckle of white mix with some slight tonal color value.

The result came out not exactly the way i want them but i know why it doesn't show the way i want it is because of the size of that graphic that is 512x256 if someone can figured out how to make this image twice the size then we will have that great realistic look for the water.

This graphic is composed of multiple tiles that are trigger by the game engine to represent different time of the day and i already tried to double it size but it is not correctly read when re-size.

The point is if i can get a higher resolution i can then have better reflection detail on water surfaced and even there is a possibility of animating a reflection pattern on it that could simulated a much more advanced shader.

http://i886.photobucket.com/albums/ac68/Hans_Witteman/reflex_atlantic.jpg

See the left lower tile is the reflection.


http://i886.photobucket.com/albums/ac68/Hans_Witteman/Sea_Green.jpg

This one is the greenish tinted

http://i886.photobucket.com/albums/ac68/Hans_Witteman/Sea_Blue.jpg

For the blueish lovers.

Note these image are not realistic because of the distortion in reflect speckle and also i modified a lot of setting that i didn't reverted before taking screenshots.

Best regards Hans

Seeadler
07-26-11, 06:27 AM
If the reflection was just a texture, then it sure could be done, but the reflection I think is hardware.

The reflection colors comes from the reflection map which is a tga texture embedded in SkyColors_*.dat. The colors of this texture are transferred via a vertex-/pixel-shader combination to the water mesh.

The main color of the water is no external or embedded texture, it comes from a temporary texture generated of the water colors from the EnvColors_*.dat. This temp texture is stored at runtime in the texture registers and another vertex-/pixel-shader pair map this texture on the water mesh.

SH3 still uses shader model 1.1 which was originally designed for DirectX 8 although it is a DX9 game. SH4 uses shader model 2.0+ which comes with DX 9 and uses more texture-manipulation within the shaders.

urfisch
07-26-11, 10:39 AM
nice find, hans! i will give it a try too!...already spend days on this. so, whats a night...

:D

;)

and i guess, the pic is not read well when resized, cause of a fixed defined size somewhere in the dat. so the game looks for a 512x...and therefore cannot read a 1024x...but thats just an idea.

update:

i think the mesh of the water is defined with a 512x... texture. so the game exspects a 512 texture. dont know where to look for this data. EnvSim.act hasnt it stored.

Hans Witteman
07-26-11, 06:51 PM
nice find, hans! i will give it a try too!...already spend days on this. so, whats a night...

:D

;)

and i guess, the pic is not read well when resized, cause of a fixed defined size somewhere in the dat. so the game looks for a 512x...and therefore cannot read a 1024x...but thats just an idea.

update:

i think the mesh of the water is defined with a 512x... texture. so the game exspects a 512 texture. dont know where to look for this data. EnvSim.act hasnt it stored.





Hi mate,

Yes i suspected that this sprite plate is hardcoded and maybe there is no way to make it bigger but since i am no hexeditor guru i can't look at it to see if it possible to re-size it, could also be a simple line in code defining the plate as 512x256 and could required only changing value.

Take note also that my reflection test did not included a spherical graphic and the reflection is not looking correctly when near the hemisphere skydome but i just did some test so for a final version it would be inside a circle with smooth blending on edge.

I am convinced that we can at least be able to have a nice fake reflection and i think it would be better than a real shader because of performance because the more advanced the shader is the more impact it have on GPU.

I will do other test since i have other ideas to achieve our goal.

Best regards Hans

Hans Witteman
07-26-11, 09:51 PM
Hi mate,

Some more test i did and this time i am starting to be excited with this technique, this one is made with the smallest possible pixel because of the size limitation and it turn out not bad at all so it is confirming my theory that with an image double the size we then have gorgeous waters for sh3.

http://i886.photobucket.com/albums/ac68/Hans_Witteman/Sea_alpha_V_01.jpg

Best regards Hans

urfisch
07-27-11, 04:14 AM
sure! with an image with smaller pixels on the water, we will get real good looking reflection dots. i tried your method yesterday and i am also returning to deal with it today.

but as to the limitations of the texture size and the reflection effect itself (looks like a mirror), i prefer to test a bumpmap on the water. but this is not possible until someone of the codergurus help us to access the foam-definitions of the water mesh.

if we are able to change the value of the water hight where a foam is created to 0, the water will always show foam. and there are also definitions, which foam is used. so we might could also define a certain, bumpmapped texture.

this would be a very good result, i am very convinced of! and using the texture animation from anvart, we could have glittering reflection effects, like of real water!

so, where are you?...coder gurus! please help!

:salute:

Hans Witteman
07-27-11, 05:59 AM
sure! with an image with smaller pixels on the water, we will get real good looking reflection dots. i tried your method yesterday and i am also returning to deal with it today.

but as to the limitations of the texture size and the reflection effect itself (looks like a mirror), i prefer to test a bumpmap on the water. but this is not possible until someone of the codergurus help us to access the foam-definitions of the water mesh.

if we are able to change the value of the water hight where a foam is created to 0, the water will always show foam. and there are also definitions, which foam is used. so we might could also define a certain, bumpmapped texture.

this would be a very good result, i am very convinced of! and using the texture animation from anvart, we could have glittering reflection effects, like of real water!

so, where are you?...coder gurus! please help!

:salute:

Hi mate,

After some more test tonight i am close to stop experimenting with it because if no one want to give us a hand with some heavy duty hex work i think we will go no where.

Also i am pretty satisfy with the look i already have.

For your bumpmap i think it is a controller that work only for interior i don't botter with it because bumpmap where not implemented for outside and don't confused the water bump system it has nothing to do with that controller.

I think the only good solution is to have the reflex_atlantic.tga texture in a bigger resolution and i did some search with hex editor and i found nothing.

Or if someone is capable of implementing shader model 2 in Sh3 and this someone is surely not me.

Interesting fact that i noted on testing: You can have 2 different envsim controller in scene.dat i also try to link a shipwake controller to the cloud nod and it show on water but there is no value to make it cover the entire patch of ocean mesh and maybe it would be too much on the fps.

Best regards Hans

urfisch
07-27-11, 09:32 AM
yes, you can also have many different subcontrollers in the envsim node. its quite interesting, but not very helpful, til now. for further actions we need some help for this. you are right, hans.

here my new success so far, some nice, noisy light reflections on the water:

http://img268.imageshack.us/img268/166/test1yp.jpg

http://img189.imageshack.us/img189/9317/test2vu.jpg

and type II on the atlantic...

http://img20.imageshack.us/img20/6079/test3yp.jpg

more waves...

http://img11.imageshack.us/img11/2043/test4k.jpg

Hans Witteman
07-28-11, 02:38 AM
yes, you can also have many different subcontrollers in the envsim node. its quite interesting, but not very helpful, til now. for further actions we need some help for this. you are right, hans.

here my new success so far, some nice, noisy light reflections on the water:

http://img268.imageshack.us/img268/166/test1yp.jpg

http://img189.imageshack.us/img189/9317/test2vu.jpg

and type II on the atlantic...

http://img20.imageshack.us/img20/6079/test3yp.jpg

more waves...

http://img11.imageshack.us/img11/2043/test4k.jpg

Hi mate,

Nice work but try to play with the fresnel coeficient to get it darker a bit and it should greatly improved it.

Best regards Hans

urfisch
08-01-11, 06:02 PM
interesting point, anvart. will try this! thanks!

Anvart
08-01-11, 06:18 PM
...
The point is if i can get a higher resolution i can then have better reflection detail on water surfaced
and even there is a possibility of animating a reflection pattern on it that could simulated a much more advanced shader.
...
Best regards Hans
I wrote already ... You can create additional object such as SkyColor, and use this object as sky reflection model (reflection in the water)... mesh of this object must have a slightly
smaller radius than SkyColor object... and this object (we call it SkyReflection) should not
be visible... then you texture this object (texture with noise, glare and so on... and
with alpha blending!!!)... and then you can even animate this texture and/or make slow
rotation of this object... may be.

May be bad idea,... because, i think, the new object will close reflection of SkyColor's object ... even if the new object is invisible and with a-blend?? :hmmm: or not bad??? can't test it...

urfisch
08-02-11, 05:09 AM
May be bad idea,... because, i think, the new object will close reflection of SkyColor's object ... even if the new object is invisible and with a-blend?? :hmmm: or not bad??? can't test it...

dont know either, will test tomorrow. but the key of better water is not only the reflection map, its the surface map of the water, like the foam is. that was my initial idea: having the parameters of the foam creation set to wave high "0" and add a certain foam to these parameter. the new foam is a bump map, which scatters the surface, so we have better looking light reflection.

but i have no skills for that. havnt found the source-parameters of the foam creation either.

Anvart
08-02-11, 03:12 PM
@urfisch
First let play/experiment with SeaFoam parameters in EnvSim controller in scene.dat file.
... and term bump of water it's not texture bumping...

urfisch
08-02-11, 04:55 PM
already done all the stuff which is possible in the scene.dat.

this is how i managed to get these more rough looking reflections on the water. but the bump map is only a texture thing, not a real bump map, which is normally used for real looking surfaces with light reflecting roughness on it. the bump controller of the scene dat makes the waves have more or less dark (and bigger and smaller ones) areas, but does not cause reflections! so "bump controller" is not the right name for this entry. its a "fake bump map", useless for the reflection thing.

:-?

the possibilities of the scene.dat modding are already at their limit.

one problem, which we cannot solve, is increasing the reflections on one hand and have them not rendered in distance on the other hand - or have them rendered smaller and in less appearance. this makes the nicer looking effect of better reflections in the closer view (around your boat) looking odd in the far distance. it results in an unreal "blinking" ocean surface all the way to the horizont. already tested changing the "LOD" factor...but no success.

CONCLUSION

as to all my experiments (which have taken several days, over 100 hours) with the scene.dat parameters, i am definitely convinced the only way to real better water is adding the shader technology of sh4 OR giving the water "fake shaders" by having a new foam texture, which is always rendered onto the water as a real bump map AND having this texture not rendered in far distance (LOD)!

Kapitanleutnant
08-02-11, 05:53 PM
There's some gorgeous looking water in this thread. I'd love to see some really high quality stuff like this in game, considering how much time we spend staring at the sea.

Anvart
08-03-11, 06:18 AM
already done all the stuff which is possible in the scene.dat.

this is how i managed to get these more rough looking reflections on the water. but the bump map is only a texture thing, not a real bump map, which is normally used for real looking surfaces with light reflecting roughness on it. the bump controller of the scene dat makes the waves have more or less dark (and bigger and smaller ones) areas, but does not cause reflections! so "bump controller" is not the right name for this entry. its a "fake bump map", useless for the reflection thing.

:-?

the possibilities of the scene.dat modding are already at their limit.

one problem, which we cannot solve, is increasing the reflections on one hand and have them not rendered in distance on the other hand - or have them rendered smaller and in less appearance. this makes the nicer looking effect of better reflections in the closer view (around your boat) looking odd in the far distance. it results in an unreal "blinking" ocean surface all the way to the horizont. already tested changing the "LOD" factor...but no success.

CONCLUSION

as to all my experiments (which have taken several days, over 100 hours) with the scene.dat parameters, i am definitely convinced the only way to real better water is adding the shader technology of sh4 OR giving the water "fake shaders" by having a new foam texture, which is always rendered onto the water as a real bump map AND having this texture not rendered in far distance (LOD)!
:hmmm:
Sorry.
I badly understand you...
On the one hand you say the obvious things... on the other hand, as i think, you strangely understand the work of water program. May be to blame the language barrier...

urfisch
08-04-11, 06:04 AM
hmmm...maybe the language. but which "understanding of water" do you mean?

fact is: we have no real bump controller in the scene dat. its a fake "bump" only for dark/bright areas on the water. not a reflection. normal bump maps are for rendering light reflections, this one in scene.dat works different.

i tested everything the scene.dat lets us change. result is better reflections on the water, with a slightly more rough looking surface as shown in this thread.

PROBLEM and LIMITS

when reaching a real good looking reflecting surface nearby the boat, it looks odd in the distance, cause there is no accessable parameter for changing the render distance of the water surface effects. so the water shimmers and blinks heavily in the distance -> ugly.

---

so, conclusion for a better surface of the water is: getting a new foam texture added, used by water with wave height "0-2 -> normal state" or linked to different wind conditions EVEN UNDER 6, where some foam is beeing created. this texture should contain water surface noise and be defined as "bumpmap" -> giving us better, rough looking reflections -> as bumpmaps seem to work nicely on the u-boat hull. same should then work on the water surface, right? or am i wrong?

Hans Witteman
08-04-11, 07:55 PM
Hi mate,

Finally after almost a week of testing every possible combinations i did achieve the look i was after and it was no ride in the park!

I had to think outside the box for this one because the parameters we have for reflective materials in our 3d software is not related at all with the reflective materials in SH3 so i tried thinking in reversed mode.

First everything had to work in combination like the reflex_Atlantic.tga i did a lot of blending in paint program to achieve a very subtle effect almost invisible to the eyes in the program but that was the key to avoid too much flickering in SH3.

After that i crank the FresnelCoe to high value and raised the reflection distorsion to brake the pattern from showing on top of breakink wave and to finish i adjust clouds reflexion to get this :

http://i886.photobucket.com/albums/ac68/Hans_Witteman/reflex_atlantic_or.jpg

http://i886.photobucket.com/albums/ac68/Hans_Witteman/Ocean_05.jpg

http://i886.photobucket.com/albums/ac68/Hans_Witteman/Ocean_04.jpg

http://i886.photobucket.com/albums/ac68/Hans_Witteman/Ocean_03.jpg

http://i886.photobucket.com/albums/ac68/Hans_Witteman/Ocean_02.jpg

http://i886.photobucket.com/albums/ac68/Hans_Witteman/Ocean_01.jpg

I am totally satisfy with this kind of ocean for SH3 with stock shader i will adjust it further a bit but this one truly work and have zero impact on frame rate.

Edit: I forgot to mention that i forced my antialias setting to 4xx on video card.

Best regards Hans

urfisch
08-05-11, 03:38 AM
looks not bad, hans! nice shader. could you send me this one via pm? will have some test with it also.