Enable or disable a track mesh or object using CSP conditions?

Discussion in 'Tracks' started by MGMetroDave, Oct 27, 2019.

  1. MGMetroDave

    MGMetroDave Active Member

    Joined:
    Apr 7, 2019
    Messages:
    141
    Likes Received:
    159
    Sorry me again!
    I've been trying to find out a way to enable or disable a mesh or object in my track using CSP's conditions (such as time of day or year). I would imagine this might be possible?

    By disable I mean remove/not render it at all (rather than just making it transparent), so that when it's disabled it won't affect the FPS. Is this possible? I'm still getting to grips with the amazing flexibility and functionality of CSP!

    Thanks in advance!
     
  2. Johnr777

    Johnr777 Moderator

    Joined:
    Jul 26, 2017
    Messages:
    1,050
    Likes Received:
    614
    Hey Dave

    To disable a mesh via CSP, you need a tag like this:
    [MESH_ADJUSTMENT_...]
    MESHES = objectname
    IS_RENDERABLE = 0

    BUT, to bind it to a condition like time of day, you need this:
    CONDITION = NIGHT_SHARP

    And im pretty sure you cant bind MESH adjustments to that, only material Im afraid.
     
  3. MGMetroDave

    MGMetroDave Active Member

    Joined:
    Apr 7, 2019
    Messages:
    141
    Likes Received:
    159
    Thanks @Johnr777 . You're absolutely right. It works but only on re-loading the game, so also not on conditions. Never mind. Thanks for trying to help!
     
  4. Johnr777

    Johnr777 Moderator

    Joined:
    Jul 26, 2017
    Messages:
    1,050
    Likes Received:
    614
    What are you trying to hide from the scenery?
     
  5. MGMetroDave

    MGMetroDave Active Member

    Joined:
    Apr 7, 2019
    Messages:
    141
    Likes Received:
    159
    Thanks John. I'm working on a track and mainly thinking of trying to hide a few objects at night that wouldn't realistically be there at that time of day, and add objects that would appear at night.

    I suppose I could just make them transparent at night (would that work?), and make sure I use as few triangles as possible on the mesh to avoid significant FPS drop. I've not tried it yet though. Was just trying to optimise as much as possible.
     
  6. MGMetroDave

    MGMetroDave Active Member

    Joined:
    Apr 7, 2019
    Messages:
    141
    Likes Received:
    159
    Also, hope I don't sound too stupid asking this, but how do you oracles know about these settings (such as the IS_RENDERABLE = 0 you mentioned earlier). Is there documentation somewhere that I've missed? I thought I'd looked through the entire web! :lol:

    Thanks again for your help!
     
    luchian likes this.
  7. Johnr777

    Johnr777 Moderator

    Joined:
    Jul 26, 2017
    Messages:
    1,050
    Likes Received:
    614
    :lol:

    Nah, a lot of it is somewhat documented in the patch’s github.

    All the config lines for tracks are outlined here... https://github.com/ac-custom-shaders-patch/acc-extension-config/blob/master/_doc_config_tracks.ini

    But don’t expect a lot of info :lol:
     
    MGMetroDave likes this.
  8. MGMetroDave

    MGMetroDave Active Member

    Joined:
    Apr 7, 2019
    Messages:
    141
    Likes Received:
    159
    Awesome thanks!
     
  9. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,117
    Likes Received:
    379
    for ks_nordschleife i used shader ksPerPixelAlpha and change the "alpha"-value to >0 at night, maybe you could use it the other way around (but its still in the RenderPipeline i think, so not really what you want):

    [INCLUDE]
    INCLUDE=common/conditions.ini
    ...
    [MATERIAL_ADJUSTMENT_66]
    DESCRIPTION=make big sky flooder visible at night
    MATERIALS=contrails
    KEY_0=alpha
    VALUE_0=0.01
    VALUE_0_OFF=ORIGINAL
    CONDITION=NIGHT_SMOOTH

    contraiils333 (1).jpg

    ;;;;;;;;;;; this you will probably not need:
    [MATERIAL_ADJUSTMENT_68]
    DESCRIPTION=make big sky flooder glow Nürburg
    MESHES=Contrails.002
    KEY_0=ksEmissive
    VALUE_0=255,120,40,0.1
    VALUE_0_OFF=ORIGINAL
    CONDITION=NIGHT_SMOOTH
     
  10. MGMetroDave

    MGMetroDave Active Member

    Joined:
    Apr 7, 2019
    Messages:
    141
    Likes Received:
    159
    Thanks @fughettaboutit! Yes, not exactly what I was after but it'll certainly be ok if I keep the triangle count really low. Thanks for the info!
     
  11. Johnr777

    Johnr777 Moderator

    Joined:
    Jul 26, 2017
    Messages:
    1,050
    Likes Received:
    614
    The thing is, it wont. Still rendered even if transparent.
     
  12. MGMetroDave

    MGMetroDave Active Member

    Joined:
    Apr 7, 2019
    Messages:
    141
    Likes Received:
    159
    @Johnr777 Yes not ideal, but it'll probably do if it's just one or two low poly objects. Just had an idea though. Is it possible to adjust the LOD level of a mesh with conditions? If so, I could use the conditions to set the LOD distances to something very very high, to achieve the same effect? Perhaps?
     
  13. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,117
    Likes Received:
    379
    mh maybe, you can test it

    [SHADER_REPLACEMENT_0]
    MESHES = gr_?KSLAYER? ; mesh-filter
    ;;; or - MATERIALS=water ; material filter
    LOD_IN = 0 ; set LOD values
    LOD_OUT = 600 ; set LOD values
    CONDITION=NIGHT_SMOOTH

    for shader values this works, but idk about object-settings
    shader values you have VALUE and VALUE_OFF
    this is not there for objects
    so seems not to be the way
     
  14. MGMetroDave

    MGMetroDave Active Member

    Joined:
    Apr 7, 2019
    Messages:
    141
    Likes Received:
    159
    I'll test it and report back! Thank you!
     
  15. Johnr777

    Johnr777 Moderator

    Joined:
    Jul 26, 2017
    Messages:
    1,050
    Likes Received:
    614
    Unfortunately theres only so much that can be bind with a condition tag. Otherwise we'd have no problem with wet surfaces, etc :lol:
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice