experimental q3map feature: brush content control

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
reyalp
Posts: 11
Joined: Sat Apr 30, 2005 7:23 pm

experimental q3map feature: brush content control

Post by reyalp »

I posted this over on the q3map2 forum, but it might be of interest to some people here as well.

http://www.splashdamage.com/index.php?n ... ic&t=11906

Problem:
Some shader keywords (such as nonsolid, *clip, liquid, and so on) affect the contents of a brush rather rather than just a given side. Since shaders are only specified on brush sides, this raises the question of which side specifies the brush contents. In past version of q3map (and q3map2) the 'first' side of the brush was used. Unfortunately, which side is 'first' is not under user control and tends to change every time the map is saved.

Solution:
This patch adds a new compiletime shader keyword

q3map_contentpriority <N>

See the post on SD for full details and download. Be warned that I have only tested this briefly (works for me (tm)) and, although this change is pretty simple, I'm not intimately familiar with the guts of q3map. You have been warned!

Bug reports or general feedback on the idea would be appreciated. If the idea is well received, I'll try to get it into the official distribution.

And BTW, good to see some life around LEM again. My old account (SCDS_reyalP) seems to have gone away, but I was an occasional poster here in the past.
Kat
Posts: 952
Joined: Tue Nov 14, 2000 8:00 am

Post by Kat »

interesting.. so I guess this solves (at least in part) the old fog and water brush problems?
[url=https://www.katsbits.com/tutorials#q3w]Tutorials, tools and resources[/url]
reyalp
Posts: 11
Joined: Sat Apr 30, 2005 7:23 pm

Post by reyalp »

Kat wrote:interesting.. so I guess this solves (at least in part) the old fog and water brush problems?
If you mean having the contents change because you have, say nodraw on a side of your fog or water brush, yes. If that isn't the problem you are referring to, maybe you could describe it in more detail.

My change only affects which side of the brush is used to determine the contents. It is exactly the same as it would be if the side with highest priority shader happened to be the first one in the brush. It doesn't let brushes do anything they couldn't do before, it just makes it possible to mix shaders with different content predictably.

In theory, it should be possible to make q3map specify a content shader that has nothing to do with any of the brush sides, which might also be interesting. The main obstacle I see to this, is where exactly would you specify it ? Neither the shader file nor an entity key would be completely satisfactory.
Kat
Posts: 952
Joined: Tue Nov 14, 2000 8:00 am

Post by Kat »

yup, that's the problem I meant, water changing becasue it reads the nodraw 1st.
[url=https://www.katsbits.com/tutorials#q3w]Tutorials, tools and resources[/url]
reyalp
Posts: 11
Joined: Sat Apr 30, 2005 7:23 pm

Post by reyalp »

Kat wrote:yup, that's the problem I meant, water changing becasue it reads the nodraw 1st.
In that case, yes. You could make a prio -1 nodraw and use it on water, fog etc. Of course, you could also make nodrawfog and nodrawwater and get the same result.
User avatar
seremtan
Posts: 36011
Joined: Wed Nov 19, 2003 8:00 am

Post by seremtan »

I always use water caulk for non-drawn water faces. That old nodraw-on-the-sides routine never worked for me.

btw just for information, in Source it's the top face only that determines if a brush is water. The rest are all toolsnodraw (i.e. caulk). It's hardwired.
H.Reaper
Posts: 127
Joined: Sat Feb 02, 2002 8:00 am

Post by H.Reaper »

Hey !

I have been waiting so long for a such feature.

That's great.

Nice work guys.
Post Reply