Creating transparent textures ???
Moderator: Moderators
Creating transparent textures ???
People,
How i create a transparent texture (for example to use in gates/stairs) ?
Moh:aa have many transparent textures and i use, but in some cases, i need use my transparent texture.
I know, its a shader file tell to engine the transparency of texture, but i dont find a tutorial about this, some idea ????
How i create a transparent texture (for example to use in gates/stairs) ?
Moh:aa have many transparent textures and i use, but in some cases, i need use my transparent texture.
I know, its a shader file tell to engine the transparency of texture, but i dont find a tutorial about this, some idea ????
tell us what image editor u have. Photoshop? Paintshop? Photopaint?
In photoshop, it was easy enough. Just make ur transparent image and save it as 32bit Targa file.
For the shader, u should try to find something similar in the original shaders and do copy/paste. Also, I recommend reading the Q3 shader manual for in depth information.
In photoshop, it was easy enough. Just make ur transparent image and save it as 32bit Targa file.
For the shader, u should try to find something similar in the original shaders and do copy/paste. Also, I recommend reading the Q3 shader manual for in depth information.
Photoshop 7.0Wacko wrote:tell us what image editor u have. Photoshop? Paintshop? Photopaint?
In photoshop, it was easy enough. Just make ur transparent image and save it as 32bit Targa file.
For the shader, u should try to find something similar in the original shaders and do copy/paste. Also, I recommend reading the Q3 shader manual for in depth information.
Sorry, but the Q3 Shader manual i know, but it is very very complex and hard to understand.
A pratice example help more of read all tutorial
I doubt anyone can easily impart upon you all the knowledge you will need to understand it all in just a few short lines. May i suggest trial and error, breaking down the textures that are already done and examine those shaders as well as reading the shader bible.
You will soon have a basic enough grasp of things to get the job done.
You will soon have a basic enough grasp of things to get the job done.
Moderator


Well...Random wrote: May i suggest trial and error, breaking down the textures that are already done and examine those shaders as well as reading the shader bible.
Ok, but i have hope of a "big" head help me only tell "use this commands..." because the reference of shader like you tell, its a "bible"
Because there are different kinds of transparent textures, the best way would be to read the shader and open the targa's of an existing texture u like to do and look what's in there. What might help additionally is, that u must save ur tga's as 32-bit.mcunha98 wrote:Well...
Ok, but i have hope of a "big" head help me only tell "use this commands..." because the reference of shader like you tell, its a "bible"
Once u've done one, read the 'bible' and look up the commands used in your shader. Or the other way round, read the 'bible' until u find a interesting command, and then try to find a shader using it
MOHAA does not support 32 bit color, so saving a texture as 32 bit tga will cause an error in the game. You have to create a 24 bit texture with an alpha channel, and save that as 32 bit for transparencies.
The simplest transparent shader is something like this, presuming your alpha channel is black where it's transparent and white where it isn't:
textures/yourfolder/texturename
{
qer_keyword masked
qer_keyword whatever you want
surfaceparm solid
surfaceparm trans
cull none
{
map textures/yourfolder/texturename.tga
depthWrite
alphaFunc GE128
nextbundle
map $lightmap
}
}
The simplest transparent shader is something like this, presuming your alpha channel is black where it's transparent and white where it isn't:
textures/yourfolder/texturename
{
qer_keyword masked
qer_keyword whatever you want
surfaceparm solid
surfaceparm trans
cull none
{
map textures/yourfolder/texturename.tga
depthWrite
alphaFunc GE128
nextbundle
map $lightmap
}
}
What about this shader
textures/common/white_volumetric
{
qer_editorimage textures/common/qer_volumetric_fade.tga
qer_keyword utility
qer_trans .4
surfaceparm nolightmap
surfaceparm nonsolid
surfaceparm trans
sort additive
cull none
{
map $whiteimage
blendFunc add
rgbGen constant .15 .15 .15
nextbundle
map textures/common/qer_volumetric_fade.tga
}
{
map textures/common/dust.tga
blendFunc add
rgbGen constant .2 .2 .2
tcMod scroll -.1 0
tcMod scale 4 4
nextbundle
map textures/common/qer_volumetric_fade.tga
}
}
The .tga's don't seem to have an alpha channel I think it is done with some kind of blend function I know rgbGen constant .2 .2 .2 sets alpha but how the blend affects it not sure .
textures/common/white_volumetric
{
qer_editorimage textures/common/qer_volumetric_fade.tga
qer_keyword utility
qer_trans .4
surfaceparm nolightmap
surfaceparm nonsolid
surfaceparm trans
sort additive
cull none
{
map $whiteimage
blendFunc add
rgbGen constant .15 .15 .15
nextbundle
map textures/common/qer_volumetric_fade.tga
}
{
map textures/common/dust.tga
blendFunc add
rgbGen constant .2 .2 .2
tcMod scroll -.1 0
tcMod scale 4 4
nextbundle
map textures/common/qer_volumetric_fade.tga
}
}
The .tga's don't seem to have an alpha channel I think it is done with some kind of blend function I know rgbGen constant .2 .2 .2 sets alpha but how the blend affects it not sure .
No offense ment, but this sounds a bit confusingBalr14 wrote:...saving a texture as 32 bit tga will cause an error in the game ... and save that as 32 bit for transparencies.
And: In Photoshop, u don't have to create an extra alpha channel. Having transparency in ur image and saving it as 32-bit Targa is fine.
I do the obvious...
I open the misc_outside folder and get the iron_window_grate2.tga for understand the process. In your shader file i get the part of script to define transparency:textures/misc_outside/windowgrate2
But like PhotoShop open a "finally" image (TGA File) i dont know the process to make the final image (chanells, definitions of image (8/16 bits), etc...)
Exist a tutorial for i coming to final image ????
I open the misc_outside folder and get the iron_window_grate2.tga for understand the process. In your shader file i get the part of script to define transparency:textures/misc_outside/windowgrate2
Code: Select all
{
qer_editorimage textures/misc_outside/iron_window_grate2.tga
qer_keyword door
qer_keyword metal
qer_keyword masked
surfaceparm metal
surfaceparm fence
surfaceparm alphashadow
cull none
nomipmaps
nopicmip
{
map textures/misc_outside/iron_window_grate2.tga
depthWrite
alphaFunc GE128
nextbundle
map $lightmap
}
}
But like PhotoShop open a "finally" image (TGA File) i dont know the process to make the final image (chanells, definitions of image (8/16 bits), etc...)
Exist a tutorial for i coming to final image ????
-
panTera
- Brigadier General
- Posts: 573
- Joined: Wed Jan 29, 2003 11:46 pm
- Location: The Netherlands
- Contact:
Here is some info on making alpha masks with photoshop:
http://www.i.nation.btinternet.co.uk/tu ... ial_06.htm
http://www.i.nation.btinternet.co.uk/tu ... ial_07.htm
http://www.i.nation.btinternet.co.uk/tu ... ial_06.htm
http://www.i.nation.btinternet.co.uk/tu ... ial_07.htm
Well
I read the tutorials pointed by Pantera.
Really, is most simple to understand.
But, my final image dont is transparent...

Shader Code...
I read the tutorials pointed by Pantera.
Really, is most simple to understand.
But, my final image dont is transparent...

Shader Code...
Code: Select all
textures/teste_natural/trans1
{
qer_editorimage textures/teste_natural/trans1.tga
qer_keyword masked
surfaceparm metal
surfaceparm fence
surfaceparm alphashadow
cull none
nomipmaps
nopicmip
{
map textures/teste_natural/trans1.tga
depthWrite
alphaFunc GE128
nextbundle
map $lightmap
}
}-
panTera
- Brigadier General
- Posts: 573
- Joined: Wed Jan 29, 2003 11:46 pm
- Location: The Netherlands
- Contact:
Well then you misread something. This comes straight from the tutorial:
(...) "Once this is all set up, save the file as a TGA, and select TGA in the drop down file type menu. After naming the TGA file you will get a dialogue box prompting you to select either 24 bit or 32 bit. You must select 32 bit if the alpha channel information is to be stored in the file, if you select 24 bit the alpha channel information will be lost".
(...) "Once this is all set up, save the file as a TGA, and select TGA in the drop down file type menu. After naming the TGA file you will get a dialogue box prompting you to select either 24 bit or 32 bit. You must select 32 bit if the alpha channel information is to be stored in the file, if you select 24 bit the alpha channel information will be lost".

