Jump to content

Home

Shaders


Newbie1

Recommended Posts

Apolgies if their is an existing thread relating to this query but the search function is disabled.

 

I need a shader to represent a polished, reflective floor. Is there an existing shader & if not what to I need to do to create a Shader within the available software.

 

To apply the reflective shader to I simply place it as a surface texture on an unchaulked brush above the floor?:confused:

Link to comment
Share on other sites

Create the brush(Probably the floor). Select one of its surfaces with ctrl+shift+left click. Hit S key. Set the texture to tests/mirror_floor2. Create a misc_portal_surface above the floor. It must be within at least 64 units from the mirror_floor2 textured surface.

 

Compile. Have a nice reflective floor.

 

If you want to change the color or any other aspect about the shader then ask here it's a bit long to mention here.

Link to comment
Share on other sites

Success with the mirror floor but not as intended.

Mirror floor produced is comprised of relective black tiles.

 

I wish to produce a mirrored floor the will show the existing textures I have placed on the floor.

 

I know I should of specified more clearly but I am new to this (Hence - Newbie1) & I'm picking it up as I go along. I know the process will be more complicated to achieve a reflective floor for my custom textures but would you be able to explain how I can achieve this?:(

Link to comment
Share on other sites

Hmm. So you wanna see the walls on the floor. You should handle that with putting some light entities near the walls. So they can be seen more detailed on the floor. However it uses a gray texture and a black one for the glass effect.

 

Open the test.shader file. Find it in assets00.pk3(use winzip) if you dont have it under base/shaders folder. Once you've open the shader file with notepad, you can find the mirror_floor2 section. Copy the section into a new file called, let's say, custom.shader.

 

It should be look like this.

 

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

}

}

 

Find the env_newfoor_kej.jpg and floor02_alphab.jpg files in the assets files. Open them with Paint Shop Pro or Photoshop. Add some brightness to them and save them as different files such as env_newfloor_kejb.jpg and floor02_alphac.jpg into their corresponding directories. (Look at the directories in winzip before you extract them.)

 

Now change the shader texture name "textures/tests/mirror_floor2" to "textures/tests/mirror_floor2b" and filenames of the jpg files in custom.shader as well. Save the file into the base/shaders directory and make sure its extension is .shader not .shader.txt. The final custom.shader should be look like this :

 

textures/tests/mirror_floor2b

{

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_alphac

blendFunc GL_DST_COLOR GL_SRC_COLOR

}

{

map textures/kejim/env_newfloor_kejb

blendFunc GL_ONE GL_ONE

rgbGen const ( 0.200000 0.200000 0.200000 )

tcGen environment

}

}

 

Now you can re-run the radiant and use the new shader texture.

Link to comment
Share on other sites

Actually not so match the walls reflected on the floor, but a transparent shader that will give a reflective surface but show the custom textures I have on the floor.

 

I.e. I have a texture of an insignia set in marble for the floor. I want the reflective surface to be transparent so the textured floor is visable but appears reflective.

Link to comment
Share on other sites

Thanxs very much for your help Catscratch I now have custom refelective floors. Much appreciated.

 

 

I do have 2 new queries (I promise they will be my last on this subjecty):

 

1. Can I alter either the env_newfloor_kej.jpg or the shader script so that it is more translucent & the custom floor textures are more clearly visible?

I could add a light source directly above a problem area where the floor text is only visible from certain areas but it will seriously impair the mood created by the existing light sources.

 

2. Positioning of misc_portal_surface -

I am aware it must be no more the 64 units from surface but

a) I am having problems with the six light sources in the room (accompanied by fire FXFiles) because as I move in the compiled map some the the liht sources & effects reflected in the floor jump & flicker in an erratic & unnatural manner.

 

Should the portal positions be related to the light source - i.e. repositioning affects angle of light reflected?

 

b) I currently have a room floor comprised of 9 brushes each with a different custom shader on the floor. I have positioned misc_portal_surfaces above each surface (9 of them). Should I do this or would one portal be sufficient.

Link to comment
Share on other sites

I have used one portal but a still getting ' juttering / stuttering' reflections from light source & effects from side view map is like this. Is it position of light sources causing problem?

 

P = Portal (64 units from surface)

L = Light Source

++ = structure/brush

 

L

 

P

 

L L

 

 

+++++++++++++++++++++++++++

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...