Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by AndrewAMD. 12/05/23 10:56
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
6 registered members (3run, AndrewAMD, alibaba, fairtrader, ozgur, TipmyPip), 605 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
portalclip and shader #151249
08/30/07 20:55
08/30/07 20:55
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline OP
Expert
Slin  Offline OP
Expert

Joined: May 2005
Posts: 2,713
Lübeck
I´ve got a good looking multitextureshader and a great watershader. Now I want the Watershader to reflect the terrain with the shader. So far everything works fine but I´ve got the problem that the reflection of the terrain is only visible at the lower half of the screen.
I found out that it has to do with portalclip. It doesn´t happen if I set noshader to on for the mirrorview.

It would be great if someone can tell me a solution for this
Thanks,
Slin

Re: portalclip and shader [Re: Slin] #151250
08/31/07 04:00
08/31/07 04:00
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
portal clip is only along a plane, so it shouldn't cause your problem...

...a screenshot would really help.


Also, are you sure it's not the way the shaders rendering the image? This is the big problem I had with the portal system...


xXxGuitar511
- Programmer
Re: portalclip and shader [Re: xXxGuitar511] #151251
08/31/07 19:41
08/31/07 19:41
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline OP
Expert
Slin  Offline OP
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Have a look at the reflection of the terrain here (it is just changing the cameras tilt):


Re: portalclip and shader [Re: Slin] #151252
08/31/07 21:04
08/31/07 21:04
Joined: Mar 2006
Posts: 2,252
Hummel Offline
Expert
Hummel  Offline
Expert

Joined: Mar 2006
Posts: 2,252
The portalclip feature of the engine doesn´t works when a modell with shader is clipping by it(your terrain).
You have to use the noshader flag ...or create a clipplan with
the HLSL function clip(x) in your terrain-pixel-shader-> it clips the pixel if x<0 and so you can use you terrain shader with the water.

Last edited by Hummel; 08/31/07 21:05.
Re: portalclip and shader [Re: Hummel] #151253
09/03/07 10:26
09/03/07 10:26
Joined: Aug 2005
Posts: 512
Bayern
Schmerzmittel Offline
User
Schmerzmittel  Offline
User

Joined: Aug 2005
Posts: 512
Bayern
How can i use this clip function?

Wäre gut, wenn das jemand genauer erklären könnte.
Danke


A7 Com V7.80
Re: portalclip and shader [Re: Schmerzmittel] #151254
09/03/07 14:05
09/03/07 14:05
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline
Expert
lostclimate  Offline
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
can we get a copy of this shader?

Re: portalclip and shader [Re: Schmerzmittel] #151255
09/03/07 18:45
09/03/07 18:45
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Quote:

How can i use this clip function?

Wäre gut, wenn das jemand genauer erklären könnte.
Danke




Clip is just an intrinsic function within HLSL itself. It's used to dicard the current pixel and a great way to simulate clip planes. This is the HLSL syntax:
Code:
 
clip(x);


But be ware that when using this function, it can cause problems with multisampling. The asm function has the same use but of course a different syntax:
Code:
 
texkill;



I hope that clears it for you Schmerzmittel, srr if you can't understand it fully because of the English explanation but my Germain isn't that good either

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: portalclip and shader [Re: frazzle] #151256
09/03/07 19:02
09/03/07 19:02
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline OP
Expert
Slin  Offline OP
Expert

Joined: May 2005
Posts: 2,713
Lübeck
I have to call it in the pixelshader right? But how do I get the distance to the clipplane?
I think that I´m able to pass the clipplanes (= the waters) z-position to the shader, but I can´t use it without any transformations, can I? With wich matrix do I have to transform it with?
And I´m quite sure, that I´ll have to render the terrain with two different shaders depending on the view (one with clipping and one without) right?

Thanks for your help

Re: portalclip and shader [Re: Slin] #151257
09/03/07 19:44
09/03/07 19:44
Joined: Mar 2006
Posts: 2,252
Hummel Offline
Expert
Hummel  Offline
Expert

Joined: Mar 2006
Posts: 2,252
simple demo: http://uploaded.to/?id=zzxkbd
littel view with clipping - big view without...hope it helps

Re: portalclip and shader [Re: Hummel] #151258
09/03/07 19:58
09/03/07 19:58
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline OP
Expert
Slin  Offline OP
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Though the script looks very ugly it shows me exactly what I wanted to know.
Thank you very much for this example

Last edited by Slin; 09/03/07 19:59.
Page 1 of 2 1 2

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1