SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SHIII Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 07-25-11, 07:31 AM   #1
urfisch
Sea Lord
 
Join Date: Mar 2005
Location: Deep down in Germany
Posts: 1,969
Downloads: 42
Uploads: 0
[REQ] Howto assign "Bumpmap/texture" to the water

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?



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.

__________________


urfisch is offline   Reply With Quote
Old 07-25-11, 09:51 AM   #2
urfisch
Sea Lord
 
Join Date: Mar 2005
Location: Deep down in Germany
Posts: 1,969
Downloads: 42
Uploads: 0
Default

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.
__________________



Last edited by urfisch; 07-25-11 at 10:13 AM.
urfisch is offline   Reply With Quote
Old 07-25-11, 10:43 AM   #3
Anvart
Admiral
 
Join Date: Jan 2006
Location: Russia ®
Posts: 2,492
Downloads: 122
Uploads: 1
Default

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.
__________________
Alex ®


Moses said: "Don't create yourself an idol"...
Anvart is offline   Reply With Quote
Old 07-25-11, 11:47 AM   #4
urfisch
Sea Lord
 
Join Date: Mar 2005
Location: Deep down in Germany
Posts: 1,969
Downloads: 42
Uploads: 0
Default

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.
__________________


urfisch is offline   Reply With Quote
Old 07-25-11, 12:45 PM   #5
Wolfstriked
Grey Wolf
 
Join Date: Apr 2011
Posts: 756
Downloads: 237
Uploads: 0
Default

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.












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....






Last edited by Wolfstriked; 07-25-11 at 01:07 PM.
Wolfstriked is offline   Reply With Quote
Old 07-25-11, 01:38 PM   #6
Hitman
Pacific Aces Dev Team
 
Hitman's Avatar
 
Join Date: Sep 2002
Location: Spain
Posts: 6,109
Downloads: 109
Uploads: 2


Default

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 If the reflection was just a texture, then it sure could be done, but the reflection I think is hardware.
__________________
One day I will return to sea ...
Hitman is offline   Reply With Quote
Old 07-25-11, 01:45 PM   #7
urfisch
Sea Lord
 
Join Date: Mar 2005
Location: Deep down in Germany
Posts: 1,969
Downloads: 42
Uploads: 0
Default

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.
__________________


urfisch is offline   Reply With Quote
Old 07-25-11, 04:15 PM   #8
Anvart
Admiral
 
Join Date: Jan 2006
Location: Russia ®
Posts: 2,492
Downloads: 122
Uploads: 1
Quote:
Originally Posted by urfisch View Post
... the foam textures are listed in the EnvSim.act file ...
Are you shure?
Quote:
Originally Posted by urfisch View Post
... 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?
Quote:
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...
__________________
Alex ®


Moses said: "Don't create yourself an idol"...
Anvart is offline   Reply With Quote
Old 07-25-11, 10:46 PM   #9
rik007
Grey Wolf
 
Join Date: Jan 2002
Location: Holland
Posts: 785
Downloads: 122
Uploads: 0
Default

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).
rik007 is offline   Reply With Quote
Old 07-26-11, 05:48 AM   #10
urfisch
Sea Lord
 
Join Date: Mar 2005
Location: Deep down in Germany
Posts: 1,969
Downloads: 42
Uploads: 0
Default

@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 ****...



@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.
__________________


urfisch is offline   Reply With Quote
Old 07-26-11, 06:24 AM   #11
Hans Witteman
Kaleun of U-3
 
Join Date: Sep 2008
Location: somewhere in 1939
Posts: 1,816
Downloads: 123
Uploads: 0
Default

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.



See the left lower tile is the reflection.




This one is the greenish tinted



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
__________________




Hans Witteman is offline   Reply With Quote
Old 07-26-11, 06:27 AM   #12
Seeadler
Pacific Aces Dev Team
 
Join Date: Mar 2001
Location: Northern Germany
Posts: 1,096
Downloads: 169
Uploads: 0


Default

Quote:
Originally Posted by Hitman View Post
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.
Seeadler is offline   Reply With Quote
Old 07-26-11, 10:39 AM   #13
urfisch
Sea Lord
 
Join Date: Mar 2005
Location: Deep down in Germany
Posts: 1,969
Downloads: 42
Uploads: 0
Default

nice find, hans! i will give it a try too!...already spend days on this. so, whats a night...





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.


__________________



Last edited by urfisch; 07-26-11 at 04:25 PM.
urfisch is offline   Reply With Quote
Old 07-26-11, 06:51 PM   #14
Hans Witteman
Kaleun of U-3
 
Join Date: Sep 2008
Location: somewhere in 1939
Posts: 1,816
Downloads: 123
Uploads: 0
Default

Quote:
Originally Posted by urfisch View Post
nice find, hans! i will give it a try too!...already spend days on this. so, whats a night...





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 is offline   Reply With Quote
Old 07-26-11, 09:51 PM   #15
Hans Witteman
Kaleun of U-3
 
Join Date: Sep 2008
Location: somewhere in 1939
Posts: 1,816
Downloads: 123
Uploads: 0
Default

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.



Best regards Hans
__________________




Hans Witteman is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:18 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.