Page 1 of 1

Mirrors in DirectQ or Darkplaces?

Posted: Sat Jun 18, 2011 12:04 am
by BloodShot
Hey guys, Is it possible through a mod or in some way to make a level with mirrors in either the DirectQ engine or DP? I figured DP would be possible since it has transparent water - if it is, how would I make one, since water doesn't reflect when your looking straight at it in DP.

Re: Mirrors in DirectQ or Darkplaces?

Posted: Sat Jun 18, 2011 12:28 am
by Nahuel
mirrors... only in Glquake (i think). You can ask in engine programming!

Posted: Sat Jun 18, 2011 7:08 am
by Spirit

Posted: Sat Jun 18, 2011 12:57 pm
by Nahuel
will LordHavoc release a new stable-darkplaces for this mod?

Posted: Fri Jul 01, 2011 9:05 am
by mh
DirectQ doesn't support mirrors and is very unlikely to ever do so.

Posted: Fri Jul 01, 2011 10:33 am
by Spike
FTE supports mirrors using a small variation on q3.

Q3's portals are defined using a special entity stating the destination position matched by being within 64 units of the portal's front plane.
If that ent has its source and dest at the same point, its a mirror, regardless of its angles.

FTE's variation is that it doesn't require that portal entity. If its not found it assumes its a mirror (you can't actually specify that sort of special ent from fte's qc right now anyway).

The following shader will give a mirror with FTE.

Code: Select all

snazzymirror
{
 portal
 {
  map $diffuse
  blendfunc blend
  alphagen const $r_mirroralpha
  depthwrite
 }
}
Rename the shader, change the map to a texture which actually exists, and give it a fixed alpha value which doesn't depend upon cheat cvars, and you have a mirror for whatever texture you want.
Note that you can use a different blendmode, for a grimy, more realistic mirror.

For DP, you can probably use some sort of dpwater hack.

Posted: Mon Jul 04, 2011 12:48 am
by razvanab
For Darkplaces

dp_refract distort r g b
Makes surfaces of this shader refractive with r_water. The refraction replaces the transparency of the texture. distort is used in conjunction with the normalmap to simulate a nonplanar water surface.

here is an example:

Code: Select all

textures/test/mirror
{ 
      qer_editorimage textures/test/qer_mirror
    { 
        map textures/test/mirror
    } 
     dp_reflect 0.5 1 1 1 0.9
 }