r_mirroralpha question ...
Moderator: InsideQC Admins
9 posts
• Page 1 of 1
r_mirroralpha question ...
To anyone who knows and is bored ...
What's r_mirroralpha doing exactly?
It is something like rendering to texture from the reverse visual angle it seen? Well, it can't be that precisely because it isn't doing a texture upload.
I suppose I can walk through it but it occurs to me that altering the r_mirroralpha code could be an awesome way to make a viewscreen in Quake by instead of rendering from it's own viewpoint, rendering from the viewpoint somewhere else in the map.
You could make a security camera so some such thing. I do wonder why some video cards (Radeons?) don't support r_mirroralpha. I could probably dig thru Google to find out what OpenGL thing it hates.
I might do some experiments and post shots here.
What's r_mirroralpha doing exactly?
It is something like rendering to texture from the reverse visual angle it seen? Well, it can't be that precisely because it isn't doing a texture upload.
I suppose I can walk through it but it occurs to me that altering the r_mirroralpha code could be an awesome way to make a viewscreen in Quake by instead of rendering from it's own viewpoint, rendering from the viewpoint somewhere else in the map.
You could make a security camera so some such thing. I do wonder why some video cards (Radeons?) don't support r_mirroralpha. I could probably dig thru Google to find out what OpenGL thing it hates.
I might do some experiments and post shots here.
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-

Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
Downsider wrote:Biggest problem is the PVS and that you'd have to play with it to get it working in a networked game, I guess.
Good point. I wasn't thinking about that part. I was thinking entities.
Probably would require something like sv_novis even to do a good test.
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-

Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
Re: r_mirroralpha question ...
Baker wrote:It is something like rendering to texture from the reverse visual angle it seen?
Actually, GLQuake duplicates the whole scene's triangles, mirrors their positions accordingly to the mirror's position, and makes the mirror texture translucent. So, it's not a render-to-texture, it's more like the mirrors in Duke Nukem 3D.
-

mankrip - Posts: 915
- Joined: Fri Jul 04, 2008 3:02 am
Part of the reason I want to understand it is that in my dx8pro build I get this [a build of my engine that uses MH's Direct 3D 8.1 wrapper]:
^^ Mirror texture appears thru wall.
^^ Player gets "mirrored".
I have some cool uses for mirror alpha I'd like to experiment with.
Anyways, your explanation is helpful and maybe I can play around now.
^^ Mirror texture appears thru wall.
^^ Player gets "mirrored".
I have some cool uses for mirror alpha I'd like to experiment with.
Anyways, your explanation is helpful and maybe I can play around now.
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-

Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
Re: r_mirroralpha question ...
Hello I have a question much noob
What engines do they support r_mirroralpha like glquake or proquake?
Does any equivalent exist to this effect?
Thank you!
What engines do they support r_mirroralpha like glquake or proquake?
Does any equivalent exist to this effect?
Thank you!
hi, I am nahuel, I love quake and qc.
-

Nahuel - Posts: 492
- Joined: Wed Jan 12, 2011 8:42 pm
- Location: mar del plata
Re: r_mirroralpha question ...
John Carmack wrote:novelty features
----------------
These are some rendering tricks that were easy to do in glquake. They aren't very robust, but they are pretty cool to look at.
Kill r_mirroralpha. Kill it until it's dead.
I can tell you one engine that certainly doesn't support it...
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
-

mh - Posts: 2292
- Joined: Sat Jan 12, 2008 1:38 am
mirrors work by:
draw scene, if you see a mirror, flag that you saw it but ignore it.
if you saw a mirror:
invert view matrix and reposition view and angles to mirror (based on plane).
flip culling side
(set up a clip plane so stuff in the mirror can't be seen closer to you than the mirror itself)
redraw scene using mirrored (will need to refresh pvs)
(remove clipplane)
revert to regular matrix
draw regular transparent mirror surfaces if mirroralpha!=0
I don't actually remember if quake does the clipplane thing, hence the brackets.
while drawing the mirror, you should retain the current values in the depth buffer, and not clear that - you want to draw only in the hole of the mirror.
you can make it more robust by using stencil tests allowing mirrors in areas that stand out, by using depthrange so mirrors will always be more distant, or so.
rendertotexture stuff is more robust, but also slower.
such mirrors are basically like duke3d's mirrors, except the mapper doesn't have to generate the world geometry.
Q3's portals are basically exactly the same idea, except for the viewmatrix+cullside.
draw scene, if you see a mirror, flag that you saw it but ignore it.
if you saw a mirror:
invert view matrix and reposition view and angles to mirror (based on plane).
flip culling side
(set up a clip plane so stuff in the mirror can't be seen closer to you than the mirror itself)
redraw scene using mirrored (will need to refresh pvs)
(remove clipplane)
revert to regular matrix
draw regular transparent mirror surfaces if mirroralpha!=0
I don't actually remember if quake does the clipplane thing, hence the brackets.
while drawing the mirror, you should retain the current values in the depth buffer, and not clear that - you want to draw only in the hole of the mirror.
you can make it more robust by using stencil tests allowing mirrors in areas that stand out, by using depthrange so mirrors will always be more distant, or so.
rendertotexture stuff is more robust, but also slower.
such mirrors are basically like duke3d's mirrors, except the mapper doesn't have to generate the world geometry.
Q3's portals are basically exactly the same idea, except for the viewmatrix+cullside.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
