mirrors in et???????


(K³t!xxXnOsSXxx) #1

im wondering if the game engine supports a shader for a mirror??? like the ice lake effect that u can see the sky, but can u see ur own reflex???

its just a cuestion for decoration, isnt critical but for me sounds interesting

thx all


(weasel) #2

In Q3 it was done with misc_portal_camera and misc_portal_surface entities. Those seem to have been removed from ET. They’re not in the entities.def file anyway. You could try adding them to the def file and compiling a test map with them, but I doubt it would work. Anyway, they’re a bad idea, since they basically require every triangle to be drawn twice. Plus there’s no way of adding realistic distortion, so you end up with a perfect reflection, and it looks very fake.


(SCDS_reyalP) #3

It should be possible, it can be done in quake3 and rtcw. If you search for a tutorial on making mirrors for q3, that should show you what to do.


(ziege) #4

The Quake3 tuts I’ve seen tell us to apply the mirror shader from the ‘common’ dir. ET doesn’t seem to have this shader (there’s ‘dirty mirror’ but it has no white outline), and I don’t have Quake…


(SCDS_reyalP) #5

textures/common/mirror1
{
	qer_editorimage textures/common/mirror1.tga
	surfaceparm nolightmap
	portal
  
	{
		map textures/common/mirror1.tga
		blendfunc GL_ONE GL_ONE_MINUS_SRC_ALPHA
		depthWrite
	}
       
        

}

textures/common/mirror2
{
	qer_editorimage textures/common/qer_mirror.tga
	surfaceparm nolightmap
	portal
	{
		map textures/common/mirror1.tga
		blendfunc GL_ONE GL_ONE_MINUS_SRC_ALPHA
		depthWrite
	}
        {
               map textures/sfx/mirror.tga
	       blendFunc GL_ZERO GL_ONE_MINUS_SRC_COLOR
        }

}



You may have to substitute your own image. I also suggest renaming them to something like
textures/mymap/mymirror
or something like that.

/me waits for the copyright police to break down my door and take me away to the IP re-education camp.


(ziege) #6

Ah thank you! I was gonna just ask for it outright but didn’t know if I was allowed :smiley:


(ziege) #7

Anyone got these entities as well? :smiley:


(SCDS_reyalP) #8

This goes in your et_entities.def file. Might or might not work.


/*QUAKED misc_portal_camera (1 .5 .25) (-8 -8 -8) (8 8 8) SLOWROTATE FASTROTATE
Portal camera. This camera is used to project its view onto a portal surface in the level through the intermediary of a misc_portal_surface entity. Use the "angles" key or target a target_position or info_notnull entity to set the camera's pointing direction.
-------- KEYS --------
angles: this sets the pitch and yaw aiming angles of the portal camera (default 0 0). Use "roll" key to set roll angle.
target : point this to a target_position entity to set the camera's pointing direction.
targetname : a misc_portal_surface portal surface indicator must point to this.
roll: roll angle of camera. A value of 0 is upside down and 180 is the same as the player's view.
notfree : when set to 1, entity will not spawn in "Free for all" and "Tournament" modes.
notteam : when set to 1, entity will not spawn in "Teamplay" and "CTF" modes.
notsingle : when set to 1, entity will not spawn in Single Player mode (bot play mode).
-------- SPAWNFLAGS --------
SLOWROTATE : makes the portal camera rotate slowly along the roll axis.
FASTROTATE : makes the portal camera rotate faster along the roll axis.
-------- NOTES --------
Both the setting "angles" key or "targeting a target_position" methods can be used to aim the camera. However, the target_position method is simpler. In both cases, the "roll" key must be used to set the roll angle. If either the SLOWROTATE or FASTROTATE spawnflag is set, then the "roll" value is irrelevant.*/

//=============================================================================

/*QUAKED misc_portal_surface (1 .5 .25) (-8 -8 -8) (8 8 8)
Portal surface indicator. This will "lock on" the brush face closest to it and identify as a portal. The view displayed on the portal surface is the view of the misc_portal_camera that this entity targets. Also used for mirrors (see Notes).
-------- KEYS --------
target : point this to a misc_portal_camera that "sees" the view you want to display on the portal.
notfree : when set to 1, entity will not spawn in "Free for all" and "Tournament" modes.
notteam : when set to 1, entity will not spawn in "Teamplay" and "CTF" modes.
notsingle : when set to 1, entity will not spawn in Single Player mode (bot play mode).
-------- NOTES --------
The entity must be no farther than 64 units away from the portal surface to lock onto it. To make a mirror, apply the common/mirror shader to the surface, place this entity near it but don't target a misc_portal_camera.*/

//=============================================================================


Note, joking aside, I don’t think I’m doing anything wrong posting these. You could get them by downloading and installing the q3 version of gtkradiant, even without q3 installed. You should also be able to find them in zerowing.idsoftware.com cvs, but I only see the gamepacks for other games…


(ziege) #9

I shall try it out tommorrow, it’s most appreciated! :slight_smile:


(K³t!xxXnOsSXxx) #10

well ive tried to locate the mirror shader buti cant find it :frowning:
some 1 know where to find it


(SCDS_reyalP) #11

:weird:

Look a couple posts up in this thread.


(K³t!xxXnOsSXxx) #12

thats why i ask, cuz i cant find it in that path :disgust:


(SCDS_reyalP) #13

I posted the entire shader here, as well as the bits you need in the et_entities.def.
:banghead:

ziege hasn’t reported back whether it works or not. SD may have broken it in the code.


(weasel) #14

Portals do not function in ET. I made a simple test, compiled it and ran it in Q3, had a mirror. Changed nothing, compiled it and ran it in ET, doesn’t work.


(ziege) #15

Uhh yeh, sorry, I should have posted back and told ppl it didn’t work.