Jump to content

Wate plane + Sky box


Olby
 Share

Recommended Posts

I created a simple terrain and enabled the default skybox. If .mat file is used then the water plane will not reflect it properly.

 

With sky.tex

post-4357-0-75053400-1422703773_thumb.jpg

 

With sky.mat

post-4357-0-47945500-1422703780_thumb.jpg

Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64)

Link to comment
Share on other sites

Nope, its still messed up. Less obvious now, but there is a thick black line around the edges of water plane. Tried playing with various video settings - no difference. The snaps taken below are at max video config. Camera is not moved between the shots, note how the water plane (when skybox is set to .mat) is clipped for some reason.

 

post-4357-0-53892500-1422867377_thumb.jpg

 

post-4357-0-34480900-1422867382_thumb.jpg

 

post-4357-0-96910500-1422868917.gif

Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64)

Link to comment
Share on other sites

It's actually working as intended. Let me explain why:

 

When a texture is used a simple cubemap lookup is performed.

 

The sky material, on the other hand, is intended for placing blocks of sky that only appear in parts of the scene. This uses a derivative of the regular model shader.

 

The shader uses a clipping plane to discard pixels that are below the surface of the water when a reflection is rendered. Without this, you will actually have underwater objects rendered in the water reflection, and it will look wrong.

 

Tiny floating point imprecision is responsible for the dark line on the horizon. This is unavoidable.

 

The solution is to use the sky texture, and only use the material if you are placing blocks of sky in the scene.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

  • 7 months later...

I just stumbled upon this issue once again. I think it would help to restrict editor's Skybox file browser to .tex files only. I added a note to the API doc's entry on SetSkybox command.

Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...