Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Blitz Terrain with Evolved Water

Author
Message
Game Master1330
18
Years of Service
User Offline
Joined: 19th Oct 2007
Location: (GetReaderXYZ() * 42 ) / 0
Posted: 2nd Apr 2013 00:16
Hey,

I'm trying to use the Evolved water shader and Blitz Terrain together.

The problem is that whilst Blitz Terrain and the water shader work perfectly normally individually, when put together, this happens:

No Water:


Water:


Has anyone had this issue before?

-Matt

Position Object Game Master1330, Object Position X(Reader), Object Position Y(Reader), Object Position Z(Reader) - 5

Hide Object Game Master1330
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 2nd Apr 2013 00:20
I am having this issue right now! lol (Talk about timing...)

I'm going back to the basics to see if I can solve this. (Gonna remove the terrain and slowly add bits in until I get this issue.)

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Game Master1330
18
Years of Service
User Offline
Joined: 19th Oct 2007
Location: (GetReaderXYZ() * 42 ) / 0
Posted: 2nd Apr 2013 00:25
That's what I've been trying to do, let me know if you get somewhere

Position Object Game Master1330, Object Position X(Reader), Object Position Y(Reader), Object Position Z(Reader) - 5

Hide Object Game Master1330
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 2nd Apr 2013 00:33
Will do. No luck so far.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 2nd Apr 2013 13:54
I don't have a definite answer but I'll throw some advice.

Make sure the Field Of View (FOV) is the same on all of the cameras. Otherwise the reflections will never line up and you'll pull out all of your hair.

Some of the demos are unnecessarily complicated and cause problems then fitting them into other programs.

Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 2nd Apr 2013 13:59
The FOV won't cause the two camera images to be displayed in the top left corner, and not display the water in the main camera.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 2nd Apr 2013 14:12
No I don't believe it will. That wasn't my purpose.

Adrian
22
Years of Service
User Offline
Joined: 11th Nov 2003
Location: My Living Room
Posted: 3rd Apr 2013 15:55 Edited at: 3rd Apr 2013 16:44
I had this problem a few weeks ago.
Basically, I had to re-code my game after changing from Advanced Terrain to Blitzwerks Terrain. I simply sould not get the water to work.
After many hours of trying, it became easier to start again.

http://www.youtube.com/watch?v=qWRXkYaaAN0

It is possible to get everything working together, but I think Evolved's water shader must use cameras 1 and 2. It is possible to add more cameras after these are working (I had a missile cam that showed a launched missile point of view) .

I believe that the cameras being used MUST be defined in numerical order to work correctly, so camera 1 must be created before camera 2.

In this example:
http://www.youtube.com/watch?v=VLmdXvGMRCg
The water had to be set up before I could get the 3D camera working.

camera 0 = "normal" view.
cameras 1 and 2 for water shader
camera 3 for 2nd view for 3d side-by-side view.

I think your problem with the images appearing in the corner of the screen are to do with this. I can remember having lots of problems of this nature when I was working out the camera stuff. Stick with it though, it can be done as the above (old) demo video shows.

I added this code
to the main UpdateWater() function so it is called every time the water is updated.

I added this code

at the very end of my main loop (The loop in the above code is the end of my Main Loop.)

To add another camera view, make the camera and add the above 1st bit of code to the UpdateWater() code and set the mask to camera 4 (%10000)

This should get you going.
EDGECOM
19
Years of Service
User Offline
Joined: 7th Sep 2006
Location: US
Posted: 3rd Apr 2013 17:42 Edited at: 3rd Apr 2013 17:48
hello I have some code to make blitz terrain and the water with dark imposter to work .

step one: first you need to turn off auto render



step two: manually set up render method


Step three: add this to the main loop before the sync command


I have found the cause of the problem to be the different plugins have different rendering methods that mess up the cameras

I hope this helps
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 3rd Apr 2013 18:55
Sweet Mother Fu[|<er!!!! EDGECOM You are a legend!! I now have sweet ass water, to go with my sweet ass terrain!

Thanks for your assistance!

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Game Master1330
18
Years of Service
User Offline
Joined: 19th Oct 2007
Location: (GetReaderXYZ() * 42 ) / 0
Posted: 3rd Apr 2013 22:41
Thanks so much for helping me to fix this guys

Adrian, your game looks really nice How are you doing the sky?

Position Object Game Master1330, Object Position X(Reader), Object Position Y(Reader), Object Position Z(Reader) - 5

Hide Object Game Master1330
Game Master1330
18
Years of Service
User Offline
Joined: 19th Oct 2007
Location: (GetReaderXYZ() * 42 ) / 0
Posted: 3rd Apr 2013 22:55
Now I'm having a problem with the rendering... The old issue is fixed but now the terrain doesn't render right at the front of the screen...

Any help?



A chunk of the terrain isn't rendered.

Position Object Game Master1330, Object Position X(Reader), Object Position Y(Reader), Object Position Z(Reader) - 5

Hide Object Game Master1330
EDGECOM
19
Years of Service
User Offline
Joined: 7th Sep 2006
Location: US
Posted: 3rd Apr 2013 23:34 Edited at: 3rd Apr 2013 23:35
if the camera is below the terrain it will not draw it also make sure the camera view distance is the same for all cameras

Thank you Mobiius I am just glad to help
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 4th Apr 2013 00:29
I'm also having the same issue as Game Master again. The terrain is getting clipped too far away from the camera.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Game Master1330
18
Years of Service
User Offline
Joined: 19th Oct 2007
Location: (GetReaderXYZ() * 42 ) / 0
Posted: 4th Apr 2013 01:00
Edgecom, I have made sure that the fov and range are the same for all cameras, and that the camera is above the terrain...

For some reason, it still isn't rendering correctly

Position Object Game Master1330, Object Position X(Reader), Object Position Y(Reader), Object Position Z(Reader) - 5

Hide Object Game Master1330
EDGECOM
19
Years of Service
User Offline
Joined: 7th Sep 2006
Location: US
Posted: 4th Apr 2013 05:14
well looking at the last picture you posted the camera is on or just below the terrain. Next question is are you getting the current terrain height at the camera or from the cube. If you could post the code so I could look at it I could fix the issues faster.
Game Master1330
18
Years of Service
User Offline
Joined: 19th Oct 2007
Location: (GetReaderXYZ() * 42 ) / 0
Posted: 4th Apr 2013 13:59


You'll have to disable the sky if you don't have extends

Position Object Game Master1330, Object Position X(Reader), Object Position Y(Reader), Object Position Z(Reader) - 5

Hide Object Game Master1330
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 4th Apr 2013 14:56 Edited at: 4th Apr 2013 14:57
Quote: "well looking at the last picture you posted the camera is on or just below the terrain. "

That doesn't explain my issue...



As you can see, I'm clearly above the terrain, but the segments are being culled prematurely.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Game Master1330
18
Years of Service
User Offline
Joined: 19th Oct 2007
Location: (GetReaderXYZ() * 42 ) / 0
Posted: 4th Apr 2013 15:55
Mobiius, we have the same issue... I tried moving my camera further up and I get the same thing :\

Position Object Game Master1330, Object Position X(Reader), Object Position Y(Reader), Object Position Z(Reader) - 5

Hide Object Game Master1330
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 4th Apr 2013 16:12
I remember to have this f...g isue, and it disappear misteriously setting object radius to 0..or -1

I'm not a grumpy grandpa
EDGECOM
19
Years of Service
User Offline
Joined: 7th Sep 2006
Location: US
Posted: 4th Apr 2013 16:19
@Game Master1330 try the code if it does not work you are going to have to make your own follow camera system because DBP is not detecting the terrain meaning the camera is not colliding with the blitz terrain that is why auto collision is not working for the follow cam

there are two way to fix this off the top of my head

fix one: make a new follow camera system

fix two: create a object or mesh from the terrain that DBP can monitor for collision



@Mobiius it looks like at least from the video your water plain is following the camera. also if you have more than 1 camera you need to update the BT for every camera
Game Master1330
18
Years of Service
User Offline
Joined: 19th Oct 2007
Location: (GetReaderXYZ() * 42 ) / 0
Posted: 4th Apr 2013 17:15
Edgecom, I tried your code but the problem isn't that the camera is below the terrain. I tried moving the camera up high above the terrain, but the same issue happens.

chafari, could you explain more about the issue?

Position Object Game Master1330, Object Position X(Reader), Object Position Y(Reader), Object Position Z(Reader) - 5

Hide Object Game Master1330
Game Master1330
18
Years of Service
User Offline
Joined: 19th Oct 2007
Location: (GetReaderXYZ() * 42 ) / 0
Posted: 4th Apr 2013 17:19
I have found the solution.

In the water update function, you need to make sure you do this for each camera (Including reflection and refraction camera:



Position Object Game Master1330, Object Position X(Reader), Object Position Y(Reader), Object Position Z(Reader) - 5

Hide Object Game Master1330
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 4th Apr 2013 17:20
@Game Master1330
My issue was on the terraing that disappear as seen in the video Mobiius...not sure we are talking about the same one

I'm not a grumpy grandpa
Game Master1330
18
Years of Service
User Offline
Joined: 19th Oct 2007
Location: (GetReaderXYZ() * 42 ) / 0
Posted: 4th Apr 2013 18:02
@Chafari We are Edgecom thought it was because the camera was below the terrain, but it wasn't. Same issue, try the solution

Position Object Game Master1330, Object Position X(Reader), Object Position Y(Reader), Object Position Z(Reader) - 5

Hide Object Game Master1330
EDGECOM
19
Years of Service
User Offline
Joined: 7th Sep 2006
Location: US
Posted: 4th Apr 2013 20:50
Game Master1330 did you figure out the problem then?

I could not try out the code I posted because I was not home I had a feeling it had something to do with the camera or with BT LOD / Culling
Game Master1330
18
Years of Service
User Offline
Joined: 19th Oct 2007
Location: (GetReaderXYZ() * 42 ) / 0
Posted: 4th Apr 2013 21:11
Yeah thanks for your help

I was rendering to camera 0 without first updating the culling and LOD :/

Position Object Game Master1330, Object Position X(Reader), Object Position Y(Reader), Object Position Z(Reader) - 5

Hide Object Game Master1330
Adrian
22
Years of Service
User Offline
Joined: 11th Nov 2003
Location: My Living Room
Posted: 4th Apr 2013 21:56 Edited at: 4th Apr 2013 22:01
Quote: "Adrian, your game looks really nice How are you doing the sky?
"


It's a very large sphere, inside out (i.e. negative size), with a sky texture, centred on the ship's XYZ location.

I also have come across the terrain sectors not rendering properly. I was using automatic rendering but when I changed to manual it became much better. It IS more confusing to program but it does seem to be more reliable once working.

I have a problem when I unload an old terrain and create a new one.
One out of every four or so times the program will crash with no error message. I think it's trying to draw a sector of the terrain which hasn't been loaded correctly.
It never crashes if I just use a single terrain, and I can modify the terrain freely too, but if I delete it and create another one, sometimes it crashes completely.
Anyone else found this? I am using the paid-for version if that matters.

I believe that BT 3 is on its way soon too. Looking forward to that.

Login to post a reply

Server time is: 2026-07-06 20:52:15
Your offset time is: 2026-07-06 20:52:15