Jump to content


Photo

What is the spawnarg to make decals draw in front?


9 replies to this topic

#1 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 36020 posts

Posted 01 January 2017 - 11:40 AM

I have a wall with dirt decals and posters on top.  The dirt decals draw overtop of the posters until the player approaches them, at which point they switch.  I'm pretty sure there's a command that will make one decal draw in front of another all the time, but a search isn't bringing any results.  Anyone remember what that is?

 

 


Posted Image

#2 Goldwell

Goldwell

    Team Member

  • Active Developer
  • PipPipPipPip
  • 2072 posts

Posted 01 January 2017 - 11:52 AM

I have a wall with dirt decals and posters on top.  The dirt decals draw overtop of the posters until the player approaches them, at which point they switch.  I'm pretty sure there's a command that will make one decal draw in front of another all the time, but a search isn't bringing any results.  Anyone remember what that is?

 

 

 

Isn't that "inline" "1" ?


The Accountant Series
Part 1 (coming soon) | Part 2: New In town


Lord Edgar Trilogy
Lord Edgar's Bathhouse | Lord Edgar's Disappearance | Lord Edgar's Estate
 
Stand Alone Missions
Spring Cleaning


#3 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 11570 posts

Posted 01 January 2017 - 12:53 PM

Are you thinking of these?

 

r_offsetfactor -2
r_offsetunits -0.1

  • Anderson likes this

#4 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 7438 posts

Posted 01 January 2017 - 01:38 PM

Please post the material def.

Typically, "sort decal" would be enough

https://modwiki.xnet...global_keyword)

though polygonOffset 1 can also help:

https://modwiki.xnet...global_keyword)

DECAL_MACRO includes both of these options:

https://modwiki.xnet...global_keyword)

and offsetfactor \ units will affect these too.
  • Anderson likes this
Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#5 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 36020 posts

Posted 01 January 2017 - 04:27 PM

Are these things that have to go on the material file, or can they go directly on the func_static with the decal on it?


Posted Image

#6 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 7438 posts

Posted 01 January 2017 - 04:30 PM

Are these things that have to go on the material file, or can they go directly on the func_static with the decal on it?


These are material attributes. I don't think there's an Entity argument that can do this.
Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#7 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 36020 posts

Posted 01 January 2017 - 05:21 PM

Please post the material def.

 

 

textures/darkmod/decals/papers/posted_collection03 // an assorted collection of posters for filling large areas
{
  surftype15
  description "paper"

    noshadows
    nonsolid


      {
     blend diffusemap
       map textures/darkmod/decals/papers/posted_collection03
       alphaTest 0.5
    }

    // TDM Ambient Method Related
    {                            
        if (global5 == 1)        
        blend add                
        map                textures/darkmod/decals/papers/posted_collection03
        scale            1, 1        
        red                global2    
        green            global3    
        blue            global4    
    }                            

}


Posted Image

#8 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 7438 posts

Posted 01 January 2017 - 05:35 PM

OK. Thinking on this, what you have is not the old problem but a general sort issue (and it's almost the reverse issue).

The material is just a regular diffuse map (not a real decal) so any (real) decal on the same plane will render over
the top. In your case the dirt decal and the "decal" poster are near enough to the same plane that the boundary math
causes them to swap.

Try adding "sort medium" to the material:
 
textures/darkmod/decals/papers/posted_collection03 // an assorted collection of posters for filling large areas
{
  surftype15
  description "paper"
  sort medium
    noshadows
    nonsolid

etc etc


Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#9 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 36020 posts

Posted 01 January 2017 - 07:55 PM

Tried adding that line but there was no obvious change.


Posted Image

#10 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 7438 posts

Posted 02 January 2017 - 02:18 AM

I tried everything I could think of. noOverlays failed to cure it. sort postProcess failed to cure it.

-

Finally, I fiddled with the offset settings and found that

 

r_offsetfactor -0.5

 

cured it.

 

The problem being, different values will change the likeliness of z-fighting in existing missions.

We'd need to test to see if this works better for most of the missions.

 

Edit 2:

 

Cursory tests:

 

Good:

Fiasco at Fauchard St., King of Diamonds, Down by the Riverside, Business as Usual, Return to the City, COM: Behind Closed Doors, Sir Talbot all look fine.

No major z-fighting with the new value.

 

Bad:

 

No Honor Among Thieves: Politics (mission 1) has some somewhat annoying z-fighting on the upper building areas

but fairly minor.

TD2: Chalice of Kings has a dirt decal on the ground that gets worse. It isn't fully cured unless you set offsetfactor to -4.


Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users