I have a little problem, I’m not too good with shaders :lol:. I’ve been wresling tens of hours with this issue, but still my terrain gets messed up when I do light compile. I have read tutorials and tried to learn from shader manual. Everything else looks really awsome. Everything works (not light compile stuff ofc…) nicely with bsp only compile, but I want great lightning and shadows. There are three things:
-
No shadows are cast on to the terrain. What part of the shader affects on this?
-
Blending gets washed of with light compile. Foliage and some bushes starts looking awful. I can change the models, but I need help with this blend issue.
-
Texture starts looking completely different. It get’s really ugly.
The problem is only with the terrain. Here is my shaders for terrain and skybox:
textures/duel_site/grass
{
qer_editorimage textures/sage/duel_site.jpg
q3map_lightImage textures/temperate_sd/master_grass_dirt3.tga
q3map_nonplanar
q3map_shadeAngle 179
q3map_tcGen ivector ( 512 0 0 ) ( 0 -512 0 )
q3map_lightmapAxis x
q3map_lightmapmergable
q3map_alphaMod dotproduct2 ( 0 0 2 )
surfaceparm gravelsteps
surfaceparm landmine
q3map_foliage models/sage_grass/grassfoliage1a.md3 0.6 48 0.04 2
q3map_foliage models/sage_grass/grassfoliage2a.md3 0.8 48 0.03 2
q3map_foliage models/sage_grass/grassfoliage3a.md3 1 48 0.02 2 //credit rayban for models
{
map textures/temperate_sd/grass_path1.tga
rgbGen identity
}
{
map textures/temperate_sd/master_grass_dirt3.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
alphaGen vertex
rgbGen identity
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
}
}
textures/duel_site/grass_rock
{
qer_editorimage textures/sage/duel_site5.jpg
q3map_lightImage textures/temperate_sd/rock_grayvar.tga
q3map_nonplanar
q3map_shadeAngle 179
q3map_tcGen ivector ( 512 0 0 ) ( 0 -512 0 )
q3map_lightmapAxis x
q3map_lightmapmergable
q3map_alphaMod dotproduct2 ( 0 0 2 )
{
map textures/temperate_sd/master_grass_dirt3.tga
rgbGen identity
}
{
map textures/temperate_sd/rock_grayvar.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
alphaGen vertex
rgbGen identity
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
}
}
textures/duel_site/grass_nofoliage //really no foliage...
{
qer_editorimage textures/sage/duel_site2.jpg
q3map_lightImage textures/temperate_sd/master_grass_dirt3.tga
q3map_nonplanar
q3map_shadeAngle 179
q3map_tcGen ivector ( 512 0 0 ) ( 0 -512 0 )
q3map_lightmapAxis x
q3map_lightmapmergable
q3map_alphaMod dotproduct2 ( 0 0 2 )
surfaceparm gravelsteps
surfaceparm landmine
{
map textures/temperate_sd/grass_path1.tga
rgbGen identity
}
{
map textures/temperate_sd/master_grass_dirt3.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
alphaGen vertex
rgbGen identity
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
}
}
textures/duel_site/sky
{
qer_editorimage textures/sage/sky.tga
q3map_lightrgb 0.8 0.9 1.0
q3map_skylight 85 3
q3map_sun 1 .95 .9 200 145 30
skyparms - 200 -
surfaceparm nodlight
surfaceparm noimpact
surfaceparm nolightmap
surfaceparm sky
{
map textures/sage/sky.tga
rgbGen identity
}
{
map textures/sage/sky.tga
blendfunc blend
rgbGen identity
tcMod scroll 0.0005 0.00
tcMod scale 2 1
}
}
There is also issue with phongshader. I have rocks with phong shaders but they look the same with and without phong. I really suck with shaders tbh. Shader:
textures/duel_site/rock
{
q3map_nonplanar
q3map_shadeangle 60 //the value have been also 179 but it made no difference.
qer_editorimage textures/temperate_sd/rock_grayvar.tga
{
map $lightmap
rgbGen identity
}
{
map textures/temperate_sd/rock_grayvar.tga
blendFunc filter
}
}