Jump to content

Creating a working mirror


Go to solution Solved by Boothand,

Recommended Posts

Hello there JKHub.

 

I recently ran into a problem when I was working on my map. I tried to create a mirror using "system/mirror1" and "misc_portal_surface" entity placed few grids away from the mirror plane. But when I try to try the map in game, I get a missing texture at the place where I put the mirror.

I would be really grateful for any kind of help.

 

This is how the mirror looks in GTK

 

radiant.png

 

 

And this is what I get IG

 

shot20huh.jpg

 

Link to comment

Not sure how old this engine is but maybe you need to build cubemaps?  I dunno xD

 

Pulled this off the Lucasforums forum 

 

http://www.lucasforums.com/showthread.php?t=47677      Here is the original posting.

 

 

I am absolutely happy. Finally I got my mirror working. I don't know what I did wrong, but I got an answer from Raven and I just set the mirror up as written in the mail and it works.

Reading that some other ppl are having problems to get their mirrors working I'll just paste the mail:

 

-------------------

Set up the mirror just as you normally would in Q3...

 

1. Make sure the mirrored surface has a qer_mirror (or portal) surface

property (we had one in the game called mirror_floor2 in our

textures...)

 

2. Put a misc_portal_surface entity above the surface (around 16-32

units away is fine)

 

3. Make sure the surface is the only mirror the entity can see (it

doesn't like seeing more than one mirror at a time)

 

4. Make sure the surface to be a mirror is made of only one brush for

best results...

 

(our mirror texture has the following setup in the shader: 

 

textures/tests/mirror_floor2

{

qer_editorimage textures/tests/qer_mirror.tga

surfaceparm forcefield

portal

q3map_nolightmap

{

map textures/tests/qer_mirror2b

blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA

depthWrite

}

{

map textures/tests/floor02_alphab

blendFunc GL_DST_COLOR GL_SRC_COLOR

}

{

map textures/kejim/env_newfloor_kej

blendFunc GL_ONE GL_ONE

rgbGen const ( 0.200000 0.200000 0.200000 )

tcGen environment

}

}

 

The forcefield parameter makes shots bounce off of it

 

The portal parameter makes it show a reflection

 

the other texture (tests/floor02_alphab) used on it gives it a texture to

show (with an alpha value), just remove this if you want a true mirror...

 

and the last texture in the setup gave it a shiny environment map like a

piece of glass...

-------------------

 

As already written, I don't know what was wrong with my first setupsd, but I think it was the wrong mirror shader. Now it works just fine.

Vartex likes this
Link to comment

Pulled this off the Lucasforums forum 

 

http://www.lucasforums.com/showthread.php?t=47677      Here is the original posting.

I found myself similar tutorial, but it was no help with the JKA's mirror1 shader. Is it possible that came with base JKA is broken? And I have to download a new one?

 

 

Do you have the shader in a PK3? If not, do you have sv_pure set to 0 - the game won't try to load your shader otherwise.

I had the shader in pk3 when I was making this thread. Although when I tried putting it out from the pk3 and setting sv_pure to 0 it was no help as I got the same result
Link to comment
  • Solution

Shader:

 

 

 

textures/mapname/cameraportal
{
	qer_editorimage	textures/mapname/cameraportal
	surfaceparm	nonsolid
	surfaceparm	playerclip
	portal
	q3map_nolightmap
    {
        map textures/mapname/cameraportal
        blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA
        depthWrite
        alphaGen portal 2048
    }
}

 

 

 

(Snatched from Forest House)

 

 

In my test map:

mirror.jpg

Vartex likes this
Link to comment
  • 3 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...