Glass material


(pazur) #1

Hi,

I want to create my own glass material for windows. Where can I find examples in the original game files?

Is it possible to have real reflections in the glass? I believe the dome on in the official arc map has something like that (at least it reflects the surrounding without the player).

Paz


(Violator) #2

Just search for ‘glass’ in the material browser - there’s a few.

For reflections see http://wiki.splashdamage.com/index.php/Environment_Maps. I’ve done this in Steedium Mines as well and its fairly easy to set up.


(pazur) #3

Ok. Cool

Where do I need to place those info_envmap entities? Like outside a window and then inside the building another one? One side of the glass should reflect the room inside and the other the outside. Would I then need two materials on the window brush? Does the window brush need to be a light_ambient or info_envbound entity or is this not necessary if I do it via the material? I know environment maps from id-Tech3 engines where it has been a simple image in a shader stage. I’m a little bit confused by this entity stuff.


(.Chris.) #4

If you had window for example you would need outdoor portal half way between glass I would have thought in order to have outdoor env map show for outside and indoor env map show for inside.

Materials need to be set up correctly in order to use env maps, nothing to do with which entity they belong to.

The env maps themselves are generated by info_envmaps placed in your map and you define their use in ambient lights for the area they occupy.


(Violator) #5

The info_envbound is useful for outdoor areas that you can’t portal off. In Steedium Mines I placed one inside the mineshaft as that has shiny walls, the rest of the outside uses a general info_envmap with the hub and other major features in for window glass etc.

For the info_envmaps, in a nutshell it generates 6 screenshots (left,right,behind,in front,up and down) for what is seen from the point of view of the entity (note that this won’t try and use existing envmaps as it would end up in a kind of recursive mess :eek:). An info_envmap will work inside the portalled area its in unless overridden by an info_envbound.

Here’s the steel material I made for the map (also used in consite):

material textures/viotex/steel1
{
  surfacetype "metal"
  {
    diffusemap textures/viotex/steel3.tga
    bumpmap textures/viotex/steel1_local.tga
    specularmap textures/viotex/steel2.tga
    vertexcolor
  }
  {
    maskcolor
    map		makealpha( textures/viotex/steel2.tga )
  }
  {
    blend		gl_dst_alpha, gl_one
    maskalpha
    program	sfx/cubemap
    red		Parm0
    green   	Parm1
    blue		Parm2
  }
}

The ‘program sfx/cubemap’ section (with the red/green/blue after it) is the important bit here which tells the material to use the appropriate envmap depending on where the texture is used in the map.


(pazur) #6

Thanks a lot! Now I get it :slight_smile: