Post tutorial Report RSS Reflections, Mirrors, Flowing Water

DarkPlaces (and therefore Zircon engine) supports reflections, mirrors and various liquid effects. An examination of these follows.

Posted by on - Intermediate Mapping/Technical

DarkPlaces/Zircon support many texture capabilities that are not present in Quake 1.

mirrors / reflections

DarkPlaces supports one mirror plane at a time. This means you are limited to 1 mirror in any scene. A reflecting surface is a mirror. Make sure no 2 mirrors or reflecting surfaces can see each other.

Mirrors and reflections cause a second draw of a scene, so use discretion. For instance if your world is very complex, a mirror outdoors would be frowned upon.

reflect1

Looking at the above scene, in Zircon we can activate the texture pointer typing tool_texturepointer the console. This displays the texture we are looking at. We are looking at "textures/ambientcg/tiles108_black_reflect". This is a shader.

All liquid or reflecting shaders are located in the text file "scripts/dfx_liquids.shader"

This shader is as follows:

textures/ambientcg/tiles_108_black_reflect // this is the name of our shader
{
	qer_editorimage textures/ambientcg/tiles_108_black // image that the map editor should use
	{
		map $lightmap // use lightmapping
		rgbGen identity // use standard identity matrix (think of the identity matrix like "as is")
	}
	{
		map textures/ambientcg/tiles_108_black // What texture to use
	}
	dp_reflect 1 1 1 1 0.75 // [reflect factor] [red] [green] [blue] [alpha]    -- reflect plus rgba
} 

This shader has the texture name "textures/ambientcg/tiles_108_black_reflect" and if we texture a surface with this name, it will draw according the above.

The part that does the reflecting draw:

dp_reflect 1 1 1 1 0.75 // [reflect factor] [red] [green] [blue] [alpha] -- reflect plus rgba

The dp_reflect uses red 100%, green 100% blue 100% alpha 100% with 75% reflection (very reflective).

The texture being used for the draw is "textures/ambientcg/tiles_108_black" which looks like:

tiles 108 black


Pictured: textures/ambientcg/tiles_108_black

The map looks like the following in the J.A.C.K. map editor:

reflect2


Mirrors

If a shader has dp_reflect set to 100%, it is a true mirror.

mirror solid

Pictured: textures/liquids/mirror_solid

Liquids

There are so many liquid effects possible that it is hard to track them. Flowing water, light emitting water, transparent water, warping water, reflective water, lava, slime.

To make this easier, there is a map that will be available in the next alpha of Quake3_Quake1 that displays many different liquids with their names and you can see them in action.

waters

Pictured: dev_waters.bsp - liquids with their names captioned above each. LX 1500 means it is light emitting with a light factor of 1500, so that slime would glow and light itself in a dark room, for instance.

The scripts file "scripts/dfx_liquids.shader" has a wide selection of different liquid shaders. It is a text file that can be opened by a text editor.

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: