Page 1 of 1

infinite far

Posted: Sat May 05, 2012 4:22 pm
by Cleric
Is it possible to write a shader that will make a surface appear infinitely far. Like skies look infinitely far.

Re: infinite far

Posted: Sat May 05, 2012 4:33 pm
by obsidian

Re: infinite far

Posted: Sat May 05, 2012 4:35 pm
by Cleric
obsidian wrote:http://q3map2.robotrenegade.com/docs/shader_manual/general-directives.html#sort
I knew it's going to be something i saw a hundred times and never payed attention to it.
Thanks Obsidian.

Re: infinite far

Posted: Sat May 05, 2012 6:01 pm
by obsidian
Do you have an example of what you want to accomplish? Sort will allow the surface to render behind everything else, but it won't scale objects as if it were infinitely far, so it may or may not be what you are looking for.

Re: infinite far

Posted: Sun May 06, 2012 1:51 am
by Cleric
I wanted to create like a fake skybox. Something i can put on the outer side of a window and make the image look far like it has some actual depth.
But without using surfaceparm sky for it.

Re: infinite far

Posted: Sun May 06, 2012 2:13 am
by TruthfulLiar
Sorry, been way too long (read +5 years) since I last used GTK, but I vaguely remember being able to make a translucent surface (like a teleporter) that shows you a live-image feed from a GTK "camera" that you setup pointing in the direction of a sky or whatever.

Sigh... Is this making sense, can someone translate what I mean? I know, I used to do this.

Then you make a separate not-in-the-level box of sky or whatever surrounding the said directional camera. You have to connect two points together, from the first one in the window to the second (the camera) in your target area.

I believe that the surface required a special shader, that I forget which it was called but it is fairly quick to find a teleporter shader and read the code I suppose.

Re: infinite far

Posted: Sun May 06, 2012 3:22 am
by obsidian
You can either use a portal camera entity or a q3map2 _skybox entity.

Portals are used to make the Q3 teleported and mirrors, so you can see the destination or reflection on the surface.

Skybox entity projects a 360-degree capture of a mini skybox onto your sky. This is most likely what you want and works with best results.

Re: infinite far

Posted: Sun May 06, 2012 11:12 am
by Eraser
obsidian wrote:Do you have an example of what you want to accomplish? Sort will allow the surface to render behind everything else, but it won't scale objects as if it were infinitely far, so it may or may not be what you are looking for.
lol, sorry to be pendantic, but how do you scale something to make it look infinitely far away? :smirk:

Re: infinite far

Posted: Sun May 06, 2012 6:55 pm
by obsidian
Well, NOT scale... So that if you move closer to the object, it still keeps its relative size on screen.

Re: infinite far

Posted: Mon May 07, 2012 6:30 am
by CZghost
obsidian wrote:Portals are used to make the Q3 teleported and mirrors, so you can see the destination or reflection on the surface.
While we're on portals, I have question: Is it possible to make portal from mirror surface?

Re: infinite far

Posted: Mon May 07, 2012 2:55 pm
by obsidian
They are the same thing. The only difference with a portal is that it has a destination camera set for the surface.