Addon : SystemShaders1_shx
History1.09 - Added : alpha, mirrorUV and emissive factor
1.08 - Fixed transparency issues when envmap is greater than 1
1.07 - Added spcular map shaders and rimlight/reflect shaders, UVW animation on all shaders
1.06 - Changes to support SpotLights
1.05 - Added rgb2tx shaders.
1.04 - Fixed Vegetation shader not showing correct on multiple textures
1.03 - PointLight not illuminating lightmap when sun is black, fixed,
added 0015_user_bumpy_glossy_tile and 0025_user_vegetation
1.02
- Pointlight not illuminating diffuse texture when sun is black, fixed,
All shaders are compiled HLSL and are instant on selection.
1.01 - ViewVec not properly calculated, fixed.
1.00 - First release
Requirements:-
3DRad v6.49+/7.02b+ (plus
skinmesh patch patch is for 6.49/7.02 only)
-GFX card needs to support shader model 2.0 or better (Geforce 5 or better)
Download here
http://www.3drad.com/addons/SystemShaders1_shx.htm Note about lighting methodsAll bumped shaders use per pixel lighting
All non bumped use vertex lighting
Tip : To get per pixel lighting but you don't want it bumped, you can set the bump amplitude to 0 in the skinmesh dialog to achieve very smooth per pixel lighting
ALL SHADERS:1. You can finetune RGB color to texture by a simple script using
iShaderFloat3Set(OBJ_0,"cColor",floatR,floatG.floatB) and link to skinmesh.
2. You can repeat uvmap via "Bump texture Tiles" in the skinmesh dialog
3. You can mirror UV by a simple script using
iShaderFloatSet(OBJ_0,"MirrorUV",1) and link to skinmesh.
(1.09 only)4. You can tune global alpha for all shaders by using
iShaderFloatSet(OBJ_0,"cAlpha",float) and link to skinmesh.
(1.09 only)5. you can tune emissive factor for all shaders by using
iShaderFloatSet(OBJ_0,"cEmissive",float) and link to skinmesh.
(1.09 only)You can also control the skinmesh dialog options by script 1. iShaderFloatSet(OBJ_X, "TileCount", float");
2. iShaderFloatSet(OBJ_X, "environmentMapBlend", float);
How to UVW animate any shader example :float x,z=0.0f;
void Main()
{
x+=0.001; //speed in x dir
z+=0.001; //speed in z dir
iShaderFloat2Set(OBJ_X, "UVW",x,z);
}Glossy Shaders:1. You can finetune glossiness by a simple script using
iShaderFloatSet(OBJ_0,"cGloss",float) and link to skinmesh.
Bumpy shaders1. You can set bump height via "Bump Amplitude" in the skinmesh dialog
2. Or by script : iShaderFloatSet(OBJ_X, "bumpScale", float);
Basic Shaders0014_user_bumpy_tile - Supports all lightmodes sunlight, 4 pointlights, fog
Same as
0003_pp_bumpy Tiling and bump amplitude
0015_user_bumpy_glossy_tile - Supports all lightmodes sunlight, 4 pointlights, fog
Same as
0004_pp_bumpy_glossy Andro tiled bumped and glossy
0016_user_tile - Supports all lightmodes sunlight, 4 pointlights, fog, envmap reflection
Same as
0000_default 0017_user_glossy_tile - Supports all lightmodes sunlight, 4 pointlights, fog, envmap reflection
Same as
0002_pp_smooth_glossy 0020_user_cel -
WITH OUTLINE - Cel shader for cartoonish look - Supports all lightmodes sunlight, 4 pointlights, fog, envmap reflection (reflection is also cel shaded)
Special settings: 1. you can set outline thickness via "Bump Amplitude" in the skinmesh dialog
Adjusting outline thickness
Cel shaded outlined and reflective
0022_user_wireframe - Wireframe shader - Supports all lightmodes sunlight, 4 pointlights, fog, envmap reflection.
0025_user_vegetation - Supports all lightmodes (not backfaces) sunlight, 4 pointlights, fog, envmap reflection
This shader does not cull backsides and does alphatests to make textures inter-transparent.- Works great on X-trees, trees, grass, bushes etc.
0046_user_rim_bumpy_glossy_tile - Supports all lightmodes sunlight, 4 pointlights, fog
Special settings: 1. You can finetune fresnel for rim reflection or lightning by a simple script.
iShaderFloatSet(OBJ_0," Fresnel_Start", float);
iShaderFloatSet(OBJ_0," Fresnel_End", float);
iShaderFloatSet(OBJ_0," Fresnel_Multiplier", float);
iShaderFloat4Set(OBJ_0," Fresnel_Color", floatR,floatG,floatB,floatA);0047_user_rim_bumpy_tile - Supports all lightmodes sunlight, 4 pointlights, fog
Special settings: Same as above.
0048_user_rim_glossy_tile - Supports all lightmodes sunlight, 4 pointlights, fog
Special settings: Same as above.
Car using rim reflection -
Tip: Set reflection factor 2 in the skinmesh dialog.
0049_user_rim_tile - Supports all lightmodes sunlight, 4 pointlights, fog
Special settings: Same as above.
Andro in rim light (backlight)
Texture Shaders
0030_user_lightmap_bumpy - Supports all lightmodes sunlight, 4 pointlights, fog
Required textures - must be placed in the skinmesh folder
- 000_nm.<ext> - Normalmap - (ext can be any supported image format .jpg .bmp .dds .png)
- userTextureA.dds - LightMap, this has to be a DXT1 dds texture, it will blend with the mesh texture, does not tile.
Tiled texture + streched Lightmap used here. (userTextureA.dds)
0031_user_lightmap_glossy - Supports all lightmodes sunlight, 4 pointlights, fog, envmap reflection
Required textures - must be placed in the skinmesh folder
- userTextureA.dds - LightMap, this has to be a DXT1 dds texture, it will blend with the mesh texture, does not tile
0032_user_lightmap - Supports all lightmodes sunlight, 4 pointlights, fog, envmap reflection
Required textures - must be placed in the skinmesh folder
- userTextureA.dds - LightMap, this has to be a DXT1 dds texture, it will blend with the mesh texture, does not tile
0034_user_specmap_bumpy_glossy - Supports all lightmodes sunlight, 4 pointlights, fog
Required textures - must be placed in the skinmesh folder
- 000_nm.<ext> - Normalmap - (ext can be any supported image format .jpg .bmp .dds .png)
- userTextureA.dds - SpecMap, this has to be a DXT1 dds texture, it will add specular lighting to mesh texture, tiles.
0035_user_specmap_glossy - Supports all lightmodes sunlight, 4 pointlights, fog
Required textures - must be placed in the skinmesh folder
- userTextureA.dds - SpecMap, this has to be a DXT1 dds texture, it will add specular lighting to mesh texture, tiles.
0040_user_glowmap_bumpy - Supports all lightmodes sunlight, 4 pointlights, fog
Required textures - must be placed in the skinmesh folder
- 000_nm.<ext> - Normalmap - (ext can be any supported image format .jpg .bmp .dds .png)
- userTextureA.dds - GlowMap, this has to be a alpha transparent DXT5 dds texture, it will blend with the mesh texture and tiles.
0041_user_glowmap_glossy - Supports all lightmodes sunlight, 4 pointlights, fog, envmap reflection
Required textures - must be placed in the skinmesh folder
- userTextureA.dds - GlowMap, this has to be a alpha transparent DXT5 dds texture, it will blend with the mesh texture and tiles.
Andro at daylight
Andro at night
0042_user_glowmap - Supports all lightmodes sunlight, 4 pointlights, fog, envmap reflection
Required textures - must be placed in the skinmesh folder
- userTextureA.dds - GlowMap, this has to be a alpha transparent DXT5 dds texture, it will blend with the mesh texture and tiles.
0090_user_rgb2tx_bumpy_tile - Supports all lightmodes sunlight, 4 pointlights, fog
Required textures - must be placed in the skinmesh folder
- 000_nm.<ext> - Normalmap - (ext can be any supported image format .jpg .bmp .dds .png) -
(this is repeated 100 times by default) - userTextureA.dds - Could be Rock texture, this has to be a DXT1 dds texture, this will mapped to mesh Red Color
- userTextureB.dds - Could be Grass texture, this has to be a DXT1 dds texture, this will mapped to mesh Green Color
- userTextureC.dds - Could be Sand texture, this has to be a DXT1 dds texture, this will mapped to mesh Blue Color
Optional settings: 1. you can repeat all 4 texture UV via "Bump texture Tiles" in the skinmesh dialog (optional via script)
2. you can finetune individual texture UV repeatitions by a simple script using
iShaderFloat4Set(OBJ_0,"tileRGBN",floatA,floatB,floatC,floatN) and link to skinmesh.
(PS! this is multiplied with the number set in 1.)
Mesh Texture
Shader translate RGB to 3 textures
0094_user_rgb2tx_bumpy_adv_tile - Supports all lightmodes sunlight, 4 pointlights, fog
Required textures - must be placed in the skinmesh folder
- userTextureA.dds - Could be Rock texture, this has to be a DXT1 dds texture, this will mapped to mesh Red Color
- userTextureB.dds - Could be Grass texture, this has to be a DXT1 dds texture, this will mapped to mesh Green Color
- userTextureC.dds - Could be Sand texture, this has to be a DXT1 dds texture, this will mapped to mesh Blue Color
Normalmapping for individual textures has to be set via script and can be placed anywhere - <userTextureA_NM.dds> - Normalmap for userTextureA (Use script to set, see below for example)
- <userTextureB_NM.dds> - Normalmap for userTextureB (Use script to set, see below for example)
- <userTextureC_NM.dds> - Normalmap for userTextureC (Use script to set, see below for example)
Example on how to set normalmaps for each texturevoid Main()
{
int nmA, nmB, nmC;
if (iInitializing())
{
nmR = iShaderTextureCreate(".\\3DRad_res\\fxTextures\\userTextureA_NM.dds");
nmG = iShaderTextureCreate(".\\3DRad_res\\fxTextures\\userTextureB_NM.dds");
nmB = iShaderTextureCreate(".\\3DRad_res\\fxTextures\\userTextureC_NM.dds");
}
iShaderTextureSet(OBJ_0, "userTextureA_NM", nmA);
iShaderTextureSet(OBJ_0, "userTextureB_NM", nmB);
iShaderTextureSet(OBJ_0, "userTextureC_NM", nmC);
} Optional settings: 1. you can repeat all 6 texture UV via "Bump texture Tiles" in the skinmesh dialog (optional via script)
2. you can finetune individual texture UV repeatitions by a simple script using
iShaderFloat4Set(OBJ_0,"tileRGBN",floatA,floatB,floatC,floatN) and link to skinmesh.
(PS! this is multiplied with the number set in 1.) (PS! floatN has no effect here since individual normalmaps follow it's diffuse texture tiles)Individual normal mapping
