• Welcome to Twisted DIRT Forums.
 

News:

MX vs ATV Reflex PC Multi-Player back on line 10/8/2013.  Get Racing.

Main Menu

Water!

Started by Danwasaki, March 23, 2015, 12:39:45 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Danwasaki

Only a small question.
Does anyone know how I can create water in DE?

mcm2boys

You need to add a water height map and UV map which you can find on the terrain tab at the bottom of the map list.

The heights on the water height map are inverted to the heights on the disp map, so shallow water has a max depth and as the water gets deeper the heights get smaller by the amount of the depth. Just use what ever program you use to make you disp map heights but invert the map before you save it. Water level is zero ground level, so you must have a zero height in your disp map wherever you want the water to show, and then you will find that when you ride into the water the bike & rider will be as deep into the water as you set in the depth water map - even though the disp map has a value of zero, you can be below that. Hope that makes sense.. :)

The other map i'm not sure what it does, i think it controls the ripples and the direction they travel. This is what one of the RBW water maps looks like:



You could try using that as a base to make your own map.

TwizardT

so white is shallow and black is deep just like a height map but then invert the map?
and what do you need to put in in the UV-map?

TwizardT

so, i mde a river in my heightmap (full black as you said) and i made a grey watermap. i didn't adjust the uv map and it doesn't show up as water in-game do you know what's up?


mcm2boys

#4
:) I'm afraid i don't know what's wrong - or maybe the 1st line in the Water properties roll out, says include water: false - try changing that to true.. When i tested i used the UV above and the Depth map below:



I used these on a flat zero height track and i got water where i expected. Perhaps the grey was too dark and the water too high, or maybe the UV map needs to have certain values.

It looked to me like this is a height map but I can see now that actually all the channels are used, red on the edge of the shallow water and blue+green in the deeper water. I'd get those images into Photoshop and start looking at the values in diffeent places - and try to copy that. If you do get an understanding of how it works please let us know..

I won't really start using DE myself to make tracks and try these features until i have finished the development - then i will run through everything to understand how it works - but usually by then someone else has already worked it out... :)

Looks like an interesting track you got going there..


TwizardT

so its still not working :(
im using this water depthmap:

and this water uv map:

and im still using the same heightmap

also, with the new tree option (wich is awesome) i have 365 trees and it sometimes crashes randomly and sometimes it works. just saying

mcm2boys

Did you set 'include water' to True in the Water properties?


The trees do seem to be a little sensitive, i guess something in DE's Reflex compiler still has a bug. If you could link me to one of your track builds that causes a crash that might help, though i could never repeat crashes when i wanted to - which makes it very difficult to tack the problem.

TwizardT

i did set the include water to true.

do you need the database files or the compilertrack files?

TwizardT

perhaps the water only works on a track that has the baseground level set to 0? mine is set to 20.

mcm2boys

If you are importing a disp map then that will set the ground level, so if the disp map is zero(black)  where the water is - it should show up. I guess it's possible that DE is not converting your 0 level to zero in the final disp map texture.

The base ground level is just for DE to create a dispmap with that value.

Just the dB files would be good, then I can take a look at the compiled track files.

TwizardT

okay, o i have the water working now: turns out that the watermap is bigger then the heightmap, so if your heightmap is 2048 by 2048 your water map should be 1024 by 1024 or maybe even smaller, haven't tried yet. so that can maybe get fixed?

TwizardT

okay, so if i make th emap 1024 by 1024 it doesn't work and with 512 by 512 not to.
i think i might make a tutorial for the water.

and for the trees the game keeps crashing now. i have 600+ trees now. m,aybe reflex cant handle that much?

St. Angers Snare

Quote from: TwizardT on March 26, 2015, 01:03:07 PM
okay, so if i make th emap 1024 by 1024 it doesn't work and with 512 by 512 not to.
i think i might make a tutorial for the water.

and for the trees the game keeps crashing now. i have 600+ trees now. m,aybe reflex cant handle that much?

I had over 1300 trees and about 50 other objects (towers, bleachers, etc.) at one point and my game never crashed. My problem was that DE wouldn't open the track file anymore and DE itself would crash if I tried opening the file. And so I tried saving the track and trees separate by saving the ecosystem to a file of its own. I tried opening the eco file and it would either not open or it would open and the trees wouldn't be there. Having so many trees and objects like us is honestly just asking for trouble.

mcm2boys

#13
Thanks for the feedback Snare, would you mind sending me the track and supporting files for the track that crashes DE so that i can try loading it and see where DE is having trouble?

TwizardT

yeah if i stay under 300 trees it works fine

Danwasaki

Why could this not be easier... ??? ;D

St. Angers Snare

Quote from: mcm2boys on March 26, 2015, 02:23:56 PM
Thanks for the feedback Snare, would you mind sending me the track and supporting files for the track that crashes DE so that i can try loading it and see where DE is having trouble?

It was a test track and I have already overwritten it because I figured having so many objects was the reason it had an issue loading and so I didn't worry about it. I could probably easily reenact it if needed.

mcm2boys

No problem if you've already deleted the files, it's just good for me to test against known 'bad' files.


mcm2boys

I just had a thought as to why DE is crashing with too many trees/objects. I made a first stab at multithreading in DE in the last release. JamieT reported that he had problems with it so i took it out and uploaded again. If you downloaded the latest DE more than a couple of weeks back i would suggest trying to download it again now, and use the non threading version and see if this fixes the instabilities. 


Danwasaki

And how can I change the height of the water?
I dont know which colour I need.