Water scrolling texture along its mesh/UV and ocean shader?

Your forum for all discussions around Modding.
olahaldor
Posts: 253
Joined: Wed Oct 03, 2012 11:08 am
Location: Norway

Water scrolling texture along its mesh/UV and ocean shader?

Post by olahaldor »

I'm struggling with water shader on my map. It seems the ocean shader flows in only one direction. The river I have in my map is not in a straight line; it twists and turns, yet the water flows 'through the terrain' instead of following the shape of the river.

I really like how the ocean shader looks when terrain is closer to the surface, and I'd like to keep that. I'd also like to have the water look like it flows the right way.. Is there any way to combine this? Are there shaders I don't know of ingame, or made by 3rd party who could be willing to share?
TheSuBBie
Posts: 540
Joined: Wed Jun 10, 2020 11:38 am

Re: Water scrolling texture along its mesh/UV and ocean shader?

Post by TheSuBBie »

If you want multiple flow directions on a river you will need to have a seperate mesh for each direction.
Shader wise, you also have the stream shader which can be adjusted for direction in the shader attributes as can the ocean shader.
Stream shader has the advantage of not needing an onCreate function and the texture used (fake water in troughs) can be easily adjusted to suit all types of flow and eddies.
olahaldor
Posts: 253
Joined: Wed Oct 03, 2012 11:08 am
Location: Norway

Re: Water scrolling texture along its mesh/UV and ocean shader?

Post by olahaldor »

Thanks, I'll check out the stream shader.
olahaldor
Posts: 253
Joined: Wed Oct 03, 2012 11:08 am
Location: Norway

Re: Water scrolling texture along its mesh/UV and ocean shader?

Post by olahaldor »

Uhm, okay, that was an ugly shader. No transparency when the terrain is near the surface. :D
TheSuBBie
Posts: 540
Joined: Wed Jun 10, 2020 11:38 am

Re: Water scrolling texture along its mesh/UV and ocean shader?

Post by TheSuBBie »

Then you adjust the texture itself or create a new one to suit your needs as there is definitely transparency when terrain is close to surface

Image

you could start by creating a transparent texture and use a sutable normal map to give you the ripple effect and work up from there
olahaldor
Posts: 253
Joined: Wed Oct 03, 2012 11:08 am
Location: Norway

Re: Water scrolling texture along its mesh/UV and ocean shader?

Post by olahaldor »

I tested this further. I am able to apply a diffuse texture, but I can't control how much transparency there is. Alpha in either normal or diffuse helped on that. So it's a transparent effect regardless as soon as I apply a diffuse texture. I hope there's something I'm missing.
I got the texture to flow the direction of the polygons (basically the UV's are straight), no need to chop it up into several objects.
TheSuBBie
Posts: 540
Joined: Wed Jun 10, 2020 11:38 am

Re: Water scrolling texture along its mesh/UV and ocean shader?

Post by TheSuBBie »

Look at the ingame window textures they are just made using a completely transparent base layer with a second separate layer which is adjusted to
give the required transparency/colour before combining into a single DXT5 image the same method is used for transparent roofs
olahaldor
Posts: 253
Joined: Wed Oct 03, 2012 11:08 am
Location: Norway

Re: Water scrolling texture along its mesh/UV and ocean shader?

Post by olahaldor »

Tested more. Seems like transparency is controlled by luma in the image. Bright image, bright colors: opaque. Darker, transparent. Hmm this will take some getting used to, and a lot of time to balance.


Edit:
if you have transparency (not alpha) when you save to DDS, you can pick it up in GE with "Alpha blending" enabled in the material editor. So it's getting somewhere.
TheSuBBie
Posts: 540
Joined: Wed Jun 10, 2020 11:38 am

Re: Water scrolling texture along its mesh/UV and ocean shader?

Post by TheSuBBie »

if you have transparency (not alpha) when you save to DDS, you can pick it up in GE with "Alpha blending" enabled in the material editor.
What are you saving the image as DXT1 or DXT5
Seems like transparency is controlled by luma in the image
That is caused by the specular map, when first testing always do it without a specular map and create the required effect by using the smoothness/metalness sliders you could then create your own specular map if needed.

Normal map you will need to create a black layer and combine your transparent image to create a single image before trying to create the normal otherwise you will have unwanted artifactes in the normal map.

All transparency's are created using an image editor, in photoshop they are created by adjusting the Opacity or Density settings of the image on a transparent background.
olahaldor
Posts: 253
Joined: Wed Oct 03, 2012 11:08 am
Location: Norway

Re: Water scrolling texture along its mesh/UV and ocean shader?

Post by olahaldor »

I'm using the nvidia DDS exporter, it doesn't show names as DXT anymore, but BC1, BC3, BC7 etc.. I save as BC3 (RGBA).
The specular map does nothing to transparency with the stream shader as far as I can tell. Only transparency in the diffuse map affects it.
TheSuBBie
Posts: 540
Joined: Wed Jun 10, 2020 11:38 am

Re: Water scrolling texture along its mesh/UV and ocean shader?

Post by TheSuBBie »

if you have transparency (not alpha) when you save to DDS, you can pick it up in GE with "Alpha blending" enabled in the material editor,
BC3 is the same as DXT5 and you are saving an alpha layer hence the RGBA

Specular map creates more reflection so reducing transparency of the dds image, try just using the fake water image and remove exsisting spec map and adjust smoothness an metalness sliders.
olahaldor
Posts: 253
Joined: Wed Oct 03, 2012 11:08 am
Location: Norway

Re: Water scrolling texture along its mesh/UV and ocean shader?

Post by olahaldor »

Have you done this before, and have some maps you could possibly share?
I looked a lot for water texture maps but found it quite hard to find something usable.

I took the defualt water normal map and adjusted it a little, so that one's usable so far.
TheSuBBie
Posts: 540
Joined: Wed Jun 10, 2020 11:38 am

Re: Water scrolling texture along its mesh/UV and ocean shader?

Post by TheSuBBie »

I have no knowledge of what sort of effect you are looking for so any textures I have probably won't suit so the best way of doing it to your own satisfaction would be to create your own water texture, note this only applies when using the stream shader as the oceanShader only uses the normal map.(try experimenting with all sorts of normal maps wheatBottom, moss, rust etc)
Do a google image search for water texture, find one you like.
I'm using Photoshop so following menu items night be different in other editors
Open image in an image editor and crop/size to whatever size you are currently using.
Create a normal map from this image and save
Now going back to the color image you have created, you have two choices you can either just reduce the Opacity/Fill/Density (whichever sliders the image editor uses) and adjust the colour to suit or just use a part of the image to create an effect much like the ingame fake water.

To create using just a part of the image,
Create a new completely black image to whatever size you are currently using, this will make the following selection more visible when adjusting
Return to the new color image,
Select -- select color range and and chose a colour area that gives you the ripple/foam effect you require adjust the selection to increase the colour area as required.
Copy paste this selection as a new layer to the new black image you created so you have two seperate layers, now you can adjust colour/contrast etc of the selection layer to give the necessary highlights.
You can obviously repeat the selection/copy paste process to get things to your satisfaction.
When happy delete the black layer and save as DXT5 and add the new diffuse and normal map to waterplane in GE and adjust Smoothness/Metalness to suit.
You could also change the black layer to a colour that suits the river/water colour you are aiming for and after getting the highlights on the selection to your satisfaction reduce the opacity of the colour to a level you want, merge the layers and continue as above.
olahaldor
Posts: 253
Joined: Wed Oct 03, 2012 11:08 am
Location: Norway

Re: Water scrolling texture along its mesh/UV and ocean shader?

Post by olahaldor »

I'm not new to Photoshop, but the part in GE breaks with my logic :)

Do you have an example of what it'd possibly look like if you'd do all the things you mention?
TheSuBBie
Posts: 540
Joined: Wed Jun 10, 2020 11:38 am

Re: Water scrolling texture along its mesh/UV and ocean shader?

Post by TheSuBBie »

but the part in GE breaks with my logic
How does it break with your logic,I would have thought adding a diffuse texture and normal in GE then adjusting Smoothness and Metalness to suit were something you would normally do especially if there was no specific specular map in use.
Do you have an example of what it'd possibly look like if you'd do all the things you mention?
The idea behind the description of how to create the textures was for you to experiment with the methods and see if the texture created was what you require. Besides which you already have an example of what it could look like with the ingame Fake Water textures or even the stream diffuse from FS15
Post Reply