Thread: Transparent texture shadows

Results 1 to 8 of 8
  1. #1
    QPU-aligned Silencer's Avatar  
    Contributor
    Join Date
    May 2006
    Posts
    6,082

    Transparent texture shadows

    I remember there was a way to have {solidrendered textures cast shadows. I can't get it to work. What exactly needs to happen for this to work?

    I tried this:
    - Brush entity has rendermode solid and renderamount 255 as usual
    - zhlt_lightflags is set to 2 (opaque, blocks light)
    - -waddir command line argument has been set for HLRAD to point to all directories that contain used wad files.

    Here is the entire batch file that I am using:

    Code:
    SET MAP_PATH="D:\Projects\Levels\Goldsource\RMFs\SC\sc_robination_revised.map"
    SET TOOLS_PATH="D:\Steam\steamapps\common\Sven Co-op SDK\mapping\compilers"
    
    SET CSG_PARAMS=-wadinclude sc_robination.wad -wadinclude hc.wad -wadinclude ns.wad -wadinclude ns2.wad -wadinclude sc_propanic1.wad -wadinclude sc_propanic2.wad -wadinclude sc_propanic3.wad -wadinclude sc_propanic4.wad -wadinclude tower.wad -wadautodetect -cliptype simple
    SET BSP_PARAMS=
    SET VIS_PARAMS=-full
    SET RAD_PARAMS=-bounce 2 -extra -dscale 1 -waddir D:\Projects\Textures\GS\00-CUSTOM -waddir D:\Projects\Textures\GS\00-DEFAULT -waddir D:\Projects\Textures\GS\sc_robination -waddir D:\Projects\Textures\GS\sc_haunted_complex
    SET ALL_PARAMS=-estimate -threads 4 -chart -low
    
    %TOOLS_PATH%\vluzacn\hlcsg_x64.exe %MAP_PATH% %ALL_PARAMS% %CSG_PARAMS%
    %TOOLS_PATH%\vluzacn\hlbsp_x64.exe %MAP_PATH% %ALL_PARAMS% %BSP_PARAMS%
    %TOOLS_PATH%\vluzacn\hlvis_x64.exe %MAP_PATH% %ALL_PARAMS% %VIS_PARAMS%
    %TOOLS_PATH%\vluzacn\hlrad_x64.exe %MAP_PATH% %ALL_PARAMS% %RAD_PARAMS%
    
    @echo End of compiler.bat.
    @pause>nul
    I can tell it is doing something, because the lighting of the map is different (darker, especially) but solid-rendered objects don't appear to cast shadows properly (at all).

    Using v34.

  2. #2
    trigger_delay & func_lazy TrEmPlEr's Avatar  
    Artist
    Join Date
    Jul 2002
    Location
    Valve Hammer Editor 3.5 beta
    Posts
    2,283

    Re: Transparent texture shadows

    Did you used a spotlight to cast the shadows ?
    If not, try it out or just a normal light entity. I´m not sure it works with texturelighting.

    here
    Modstatus: Unknown

  3. #3
    Registered User banan2288's Avatar  
    Contributor
    Join Date
    Apr 2014
    Location
    Poland
    Posts
    246

    Re: Transparent texture shadows

    I described how to do it in my tutorial: https://sites.google.com/site/svenma.../advancedlight (you need to scroll down to ZHLT keyvalues section, and ZHLT Lightflags (p.3).
    There is an option to make solid entities cast shadow based on it's alpha channel: Click image for larger version. 

Name:	al18.jpg 
Views:	96 
Size:	31.1 KB 
ID:	16924
    Or make it cast full shadow (treating whole brush as non-transparent), also you can set color of the shadow and many more!

    Edit: oh I didn't read correctly the whole post at the first time. You already did this and it's not working. Interesting... Do you have any test map for this? I'd like to try to check it.

  4. #4
    QPU-aligned Silencer's Avatar  
    Contributor
    Join Date
    May 2006
    Posts
    6,082

    Re: Transparent texture shadows

    I see no mention of -waddir in your entire guide, so I do not understand how that is supposed to work.

    I remember something about using the compile tools' settings.txt to do this but I had a look at it and there was nothing about WAD file paths.

  5. #5
    Registered User banan2288's Avatar  
    Contributor
    Join Date
    Apr 2014
    Location
    Poland
    Posts
    246

    Re: Transparent texture shadows

    I never used command like this. I either pack wads into bsp file with -nowadtextures or exclude wad files and auto-detect them with -wadautodetect. I tested Opaque feature multiple times and I'm surprised it isn't working. Sorry if my guide is missing something but I never knew there were special conditions for this feature. Anyway, I'm not sure if wad commands have anything in common with this.

    Vluzacn's changelogs contains this line: "Now shadows from textures beginning with { are casted according to the opaque area of texture", and the next line says something about wad command but I think it's completely separate feature, not related with Opaque texture shadowing.

    Edit: Also I've been thinking if shadows projected by your texture are not too "thin" so they don't want to render. Or are too blurred to be clearly seen. Also if the whole brush is covered with same texture/texture type. Are you using func_wall or any other entity?
    Last edited by banan2288; 16-02-2016 at 11:12 AM.

  6. #6
    QPU-aligned Silencer's Avatar  
    Contributor
    Join Date
    May 2006
    Posts
    6,082

    Re: Transparent texture shadows

    It's {DUCT_VNT2 and some null-textured faces on a func_breakable. Light comes from a normal light entity. I'll test if the lightmap resolution is too low. EDIT: It's not. Actually, I think I'm just going to brush-model these three grates.
    Last edited by Silencer; 16-02-2016 at 12:39 PM.

  7. #7
    Registered User banan2288's Avatar  
    Contributor
    Join Date
    Apr 2014
    Location
    Poland
    Posts
    246

    Re: Transparent texture shadows

    I make some test and for small texture scales, on small brushes shadows won't show up. This happen due to low def shadows that scales with texture size and are less likely to be visible in smaller textures with minimal alpha "holes" (like on {DUCT_VNT2). I needed to change texture scale to more than 2.0 to make shadows any visible:

    So it's not worth to make small transparent entities to cast shadows because effects are minimal. Also func_breakable would need from you to use additional toggleable shadows (which can be done with vluzacn's entities) because shadow is not disappearing when entity is broken. Also light must be strong enough to cast any shadows.

    Lightning in GoldSrc is very primitive. Blurred shadows does not allow us to have nice things.

  8. #8
    QPU-aligned Silencer's Avatar  
    Contributor
    Join Date
    May 2006
    Posts
    6,082

    Re: Transparent texture shadows

    It seems I stand corrected. I had made some other mistake when testing the texture scale. So yeah, the lightmap resolution was actually too low. What I did now is to scale the surface that needs the resolution 0.5 x 0.5. Usually that would look terrible but it happens to work out okay in my case.

    EDIT: Thanks for the hints!
    Last edited by Silencer; 16-02-2016 at 03:45 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •