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 / More shader troubles. (GG's blend shader & BlitzTerain)

Author
Message
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 24th Apr 2013 00:52
Hello, I'm having more shader related troubles and I don't know how to fix it. (Or even if it can be fixed)

If I apply Green Gandalf's (Exellent) terrain blend shader onto a BlitzTerrain object, the BT object stops culling the edges of sectors and they become visible when viewed from below.

This means that if you use evolveds water shader, you get a nasty grid effect and worse appearing on the water.

Below is a very simple video showing what I mean. (Lines from below, normal from above.)



Basically, how can I stop this from occurring? Is it a problem with BT? Can it be fixed? Is it a problem with the shader or the terrain?

I'll also post this into the blitzterrain thread in case Kaedroho's still lurking about to see if he has an answer.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Apr 2013 16:02 Edited at: 24th Apr 2013 16:12
Sounds like a simple matter of explicitly setting the cull mode in the shader. BT seems to use different default settings of various render states from those used in DBPro.

Edit Should have looked at the video before posting. I suspect the issue is related to the way BT handles the edges of terrains. I vaguely recall reading that the terrain edges are turned over to avoid gaps appearing when different LODs are next to each other. If I'm right there might not be a simple solution if you insist on trying to render the terrain from below.
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 24th Apr 2013 18:25
I've tried setting the clipping plain, but it's not doing what I want it to.

It's currently:


If I change it to:


The camera stops rotating as it should, and just stays there.

Either my understanding of the Clip command is flawed, (probable) or this isn't the solution, but I appreciate the help regardless.

I can disable the terrain's reflection, but that solution defeats the point of having reflective water.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Apr 2013 20:27
This is part of what the Help file says:

Quote: "This command will create an optional clipping plane for the camera.

Syntax

SET CAMERA CLIP Camera Number, ClipOnOff, X, Y, Z, NX, NY, NZ

Parameters

Camera Number

Integer
The camera number
ClipOnOff

Integer
A value of 0 means no clipping. World space clipping is 1 and 2, and shader clip space is 3 and 4. To apply a reflected view, use a value of 2 or 4."


Your code seems to have turned off clipping and it looks as if you need one of 1-4 although it's hard to say which .

I've had problems getting that command to work consistently as well and I've usually resorted to doing it in the shaders themselves which is presumably less efficient (and only possible if every object has a shader applied?).
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 24th Apr 2013 21:34
Green Gandalf, you should be deified! Clipping mode 4 has sorted it.



I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Apr 2013 00:45
Great.

Login to post a reply

Server time is: 2026-07-06 20:31:49
Your offset time is: 2026-07-06 20:31:49