Making a shader receive shadows but not cast them
-
- Posts: 59
- Joined: Fri Mar 28, 2014 11:50 pm
Making a shader receive shadows but not cast them
Suppose you have a light and a brush blocking the light for another brush. I'm looking to get shadows on the blocker, but I don't want the blocker to cast a shadow on the brush behind it. Isn't there a shader command to do this? Otherwise I think the only other way is to make it a group, or a model and set _rs 1 and _cs 0, but there's got to be a better way of doing this through the shader.
Re: Making a shader receive shadows but not cast them
Try making the brushes in consideration a func_static, set entity keys:
_cs 0
_rs 1
_cs 0
_rs 1
Re: Making a shader receive shadows but not cast them
Once that works would be nice to see an image of that application.
Re: Making a shader receive shadows but not cast them
Never seen a shaderparm like that, but I've used _rs and _cs many times for what you are describing.
Q3Map2 2516 -> http://www.zfight.com/misc/files/q3/q3map_2.5.16_win32_x86.zip
Q3Map2 FS_20g -> http://www.zfight.com/misc/files/q3/q3map2_fs_20g.rar
GtkRadiant 140 -> http://www.zfight.com/misc/files/q3/GtkRadiantSetup-1.4.0-Q3RTCWET.exe
Q3Map2 FS_20g -> http://www.zfight.com/misc/files/q3/q3map2_fs_20g.rar
GtkRadiant 140 -> http://www.zfight.com/misc/files/q3/GtkRadiantSetup-1.4.0-Q3RTCWET.exe
Re: Making a shader receive shadows but not cast them
"surfaceparm trans"? ...works fine for me.
By the way, _rs & _cs are completely new for me. Is there a list (updated entities.def?) with all the "new" entity keys?
like:
_mingridlight
_minvertexlight
_blocksize
vertexremapshader1
_lightmapscale
modelscale
...
By the way, _rs & _cs are completely new for me. Is there a list (updated entities.def?) with all the "new" entity keys?
like:
_mingridlight
_minvertexlight
_blocksize
vertexremapshader1
_lightmapscale
modelscale
...
[url=https://sst13.de]Q3A Maps - by sst13[/url]
[url=https://steamcommunity.com/id/_sst13_/myworkshopfiles]Quake Live Workshop[/url]
[url=https://steamcommunity.com/id/_sst13_/myworkshopfiles]Quake Live Workshop[/url]
Re: Making a shader receive shadows but not cast them
GTKradiant 1.6.4, select a brush, hit N, bingo:
Only used for the world.
-------- KEYS --------
message : Text to print at user logon. Used for name of level.
music : Path/name of looping .wav file used for level's music (e.g. music/sonic5.wav).
_ambient OR ambient : Adds a constant value to overall lighting. Use is not recommended. Ambient light will have a tendency to flatten out variations in light and shade.
_color : RGB value for ambient light color (default 0 0 0).
gravity : Gravity of level (default 800 = normal gravity).
gridsize : Granularity of the lightgrid created by q3map. Value is three integers separated by spaces, representing number of units between grid points in X Y Z. Default gridsize value is 128 128 256. Use larger powers of 2 to reduce BSP size and compile time on very large maps.
_blocksize : Q3Map always splits the BSP tree along the planes X=_blocksize*n and Y=_blocksize*n. Increase the blocksize using larger powers of 2 to reduce compile times on very large maps with a low structural brush density (default 1024 1024 0, 0 values = disable).
-------- Q3MAP2 KEYS --------
_minlight : Minimum light value, levelwide. Uses the _color key to set color. Does not add, unlike ambient.
_minvertexlight : Minimum vertex lighting, levelwide.
_mingridlight : Minimum lightgrid (dynamic entity lighting) levelwide.
_keeplights : Keep light entities in the BSP. Normally stripped out by the BSP process and read from the .map file by the lighting phase.
_noshadersun : Ignore q3map_sun/sun directives in sky shaders and ONLY use entity sun lights.
_farplanedist : Limit on how many units the vis phase of compilation can see. Used in combination with level-wide fog, it can help reduce r_speeds on large, open maps.
_foghull : Shader to use for "fog hull". Foghull shader should be a sky shader. Omit the "textures/" prefix.
_lightmapscale : Floating point value scales the resolution of lightmaps on brushes/patches in the world. Can be overridden in func_group (or other entities) (default 1.0).
_cs OR _castshadows : Allows per-entity control over shadow casting. Defaults to 0 on entities, 1 on world. 0 = no shadow casting. 1 = cast shadows on world. > 1 = cast shadows on entities with _rs (or _receiveshadows) with the corresponding value, AND world. Negative values imply same, but DO NOT cast shadows on world.
_rs OR _receiveshadows : Allows per-entity control over shadow reception. Defaults to 1 on everything (world shadows). 0 = receives NO shadows. > 1 = receive shadows only from corresponding keyed entities (see above) and world. < 1 = receive shadows ONLY from corresponding keyed entities.
_celshader : Sets the cel shader used for this geometry. Note: Omit the "textures/" prefix. Overridable in entities.
_styleNalphaGen : *IMPORTANT* Replace "N" in the key "_styleNalphaGen" with an integer between 1 and 31 as your style index. Values takes standard shader waveform functions (e.g. wave sin 0.5 0.3 0.25 1.5)
_styleNrgbGen : *IMPORTANT* Replace "N" in the key "_styleNrgbGen" with an integer between 1 and 31 as your style index. Values take standard shader waveform functions (e.g. wave sin 0.5 0.3 0.25 1.5)
-------- Q3MAP2 TERRAIN KEYS --------
_indexmap OR alphamap : Path/name for the art file used to guide the mapping of textures on the terrain surface.
_layers OR layers : Integer value denotes number of unique root shaders that will be used on the terrain.
_shader OR shader : Path to the metashader used to assign textures to the terrain entity. Note: Omit the "textures/" prefix.
Only used for the world.
-------- KEYS --------
message : Text to print at user logon. Used for name of level.
music : Path/name of looping .wav file used for level's music (e.g. music/sonic5.wav).
_ambient OR ambient : Adds a constant value to overall lighting. Use is not recommended. Ambient light will have a tendency to flatten out variations in light and shade.
_color : RGB value for ambient light color (default 0 0 0).
gravity : Gravity of level (default 800 = normal gravity).
gridsize : Granularity of the lightgrid created by q3map. Value is three integers separated by spaces, representing number of units between grid points in X Y Z. Default gridsize value is 128 128 256. Use larger powers of 2 to reduce BSP size and compile time on very large maps.
_blocksize : Q3Map always splits the BSP tree along the planes X=_blocksize*n and Y=_blocksize*n. Increase the blocksize using larger powers of 2 to reduce compile times on very large maps with a low structural brush density (default 1024 1024 0, 0 values = disable).
-------- Q3MAP2 KEYS --------
_minlight : Minimum light value, levelwide. Uses the _color key to set color. Does not add, unlike ambient.
_minvertexlight : Minimum vertex lighting, levelwide.
_mingridlight : Minimum lightgrid (dynamic entity lighting) levelwide.
_keeplights : Keep light entities in the BSP. Normally stripped out by the BSP process and read from the .map file by the lighting phase.
_noshadersun : Ignore q3map_sun/sun directives in sky shaders and ONLY use entity sun lights.
_farplanedist : Limit on how many units the vis phase of compilation can see. Used in combination with level-wide fog, it can help reduce r_speeds on large, open maps.
_foghull : Shader to use for "fog hull". Foghull shader should be a sky shader. Omit the "textures/" prefix.
_lightmapscale : Floating point value scales the resolution of lightmaps on brushes/patches in the world. Can be overridden in func_group (or other entities) (default 1.0).
_cs OR _castshadows : Allows per-entity control over shadow casting. Defaults to 0 on entities, 1 on world. 0 = no shadow casting. 1 = cast shadows on world. > 1 = cast shadows on entities with _rs (or _receiveshadows) with the corresponding value, AND world. Negative values imply same, but DO NOT cast shadows on world.
_rs OR _receiveshadows : Allows per-entity control over shadow reception. Defaults to 1 on everything (world shadows). 0 = receives NO shadows. > 1 = receive shadows only from corresponding keyed entities (see above) and world. < 1 = receive shadows ONLY from corresponding keyed entities.
_celshader : Sets the cel shader used for this geometry. Note: Omit the "textures/" prefix. Overridable in entities.
_styleNalphaGen : *IMPORTANT* Replace "N" in the key "_styleNalphaGen" with an integer between 1 and 31 as your style index. Values takes standard shader waveform functions (e.g. wave sin 0.5 0.3 0.25 1.5)
_styleNrgbGen : *IMPORTANT* Replace "N" in the key "_styleNrgbGen" with an integer between 1 and 31 as your style index. Values take standard shader waveform functions (e.g. wave sin 0.5 0.3 0.25 1.5)
-------- Q3MAP2 TERRAIN KEYS --------
_indexmap OR alphamap : Path/name for the art file used to guide the mapping of textures on the terrain surface.
_layers OR layers : Integer value denotes number of unique root shaders that will be used on the terrain.
_shader OR shader : Path to the metashader used to assign textures to the terrain entity. Note: Omit the "textures/" prefix.
Re: Making a shader receive shadows but not cast them
Trans tells a material to be "shine through" it doesn't allow for anything more than that. With cs and rs, you can tell what object casts shadows on and/or receives light from what.sst13 wrote:"surfaceparm trans"? ...works fine for me. :D
Q3Map2 2516 -> http://www.zfight.com/misc/files/q3/q3map_2.5.16_win32_x86.zip
Q3Map2 FS_20g -> http://www.zfight.com/misc/files/q3/q3map2_fs_20g.rar
GtkRadiant 140 -> http://www.zfight.com/misc/files/q3/GtkRadiantSetup-1.4.0-Q3RTCWET.exe
Q3Map2 FS_20g -> http://www.zfight.com/misc/files/q3/q3map2_fs_20g.rar
GtkRadiant 140 -> http://www.zfight.com/misc/files/q3/GtkRadiantSetup-1.4.0-Q3RTCWET.exe
Re: Making a shader receive shadows but not cast them
Or rather, trans sets the brush to be ignored by -vis and does not try to cull objects behind it.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
Re: Making a shader receive shadows but not cast them
As for entity definition files, there's a pretty large list of stuff that I've added/cleaned up for GtkRadiant. Most of it is for Q3Map2, Q3A Point Release 1.32, and QuakeLive. It's included with the latest version of GtkRadiant.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]