Page 1 of 1

dp_reflectcube and envmap

Posted: Sat Oct 01, 2011 2:24 am
by Nahuel
Can someone explain this features of darkplaces? I do not how use it! :? What I can
achieve with this? I read dp_wiki, but i do not understand. Thanks!

Re: dp_reflectcube and envmap

Posted: Mon Oct 03, 2011 10:09 pm
by Chip
dp_reflectcube is a shader instruction that assigns an environment map to a brush.

Look at this movie. I made it using dp_reflectcube.

http://vimeo.com/13672707

So, basically, you use a command (could be envmap, I don't remember) to capture a cube map of the visible level. You, then, map that image (looks like a sky image, composed of the 6 sides of the cube) to the brush, and create the illusion that the brush is reflecting the environment. Really useful for metals.

Here's my shader:

Code: Select all

textures/tech_metal
{
	qer_editorimage textures/tech_metal.jpg
	{
		map textures/tech_metal.jpg
		blendfunc blend
	}
	dpreflectcube cubemaps/chip/chip
	{
		map $lightmap
		blendfunc add
	}
}
In my case, I used a simple metallic-like tileable texture.

Re: dp_reflectcube and envmap

Posted: Wed Oct 05, 2011 9:27 pm
by Nahuel
thanks chip!!! great :)

Re: dp_reflectcube and envmap

Posted: Thu Oct 06, 2011 7:26 am
by toneddu2000
very nice shader thanks