Possible new shader features?


(Mr_Tickles) #1

I can’t help but let my mind wander sometimes and was just thinking about some things…

Would it be possible to add a wind content parm to the shaders? It would just have a varible in it which it would pass on to certain functions. Wind could affect the trajectory of grenades, rifle nades, or even the panzer slightly. Also player’s running speed could be affected. Smoke grenades and airstrike markers could be affected. The fans could be fun to work with. :smiley:

Maybe get some trees which could blow in the wind, could inject a bit more life into the playing of maps rather than just having the scenery stationary all the time… maybe not.

Could you add a temperature content parm in aswell? Although I don’t suppose there would be much call for it. It could affect the players stamina and running speed, and the reliability of the weapons, and maybe the range of the flamethrower…

Also, along the same lines as the fog content parm, a heatwave one could be done? It could affect the players vision and create ripples at a certain distance away from the player. I say fog because, I’ve thought about it a bit, and it would seem that it’s exactly the same, just a slightly different visual affect.

Could the deformVertexes command also have an ability to allow ripples to diverge from the centre of the brush radially? I.e. if you had a well with a constant drip in the centre of it, you could get ripples to form in concentric circles from the drip… maybe even allow drips and ocean waves to both act on the same body of water… too much of a performance hit right?

For the terrain shading that a few people are working on at the moment, would it be possible to add in a matt/gloss finish? The gloss could make the lightmap have a gradient style contrast to make it appear smooth and would need to be slightly lighter to show it reflecting a bit more light. The matt affect could add a slightly darker and a noise distortion effect to the lightmap. Maybe it would be better if there was a variable in the shader which allowed you to set the “smoothness” of the surface.

What do you think?


(Gringo Starr) #2

I’m neither a shader nor game code expert, but I know the first couple you mentioned wouldn’t be done with a shader. It would take a lot of physics to make wind I imagine, and that would be in the code of the game.


(Mr_Tickles) #3

You would need to specify a certain volume in which the wind exists though, which is where the shader comes in. All it would have to contain are two variables, the wind direction and the magnitude. These variables could then be passed to the game code for people who wanted to add this feature in their mods, or if SD wanted to release some sort of patch…
(I’m pretty sure you can pass variables to the game code, mainly because the water content parm and the trigger hurt/heal/ammo affect the player. The latter ones have changeable variables which they pass to the game code).

Anyway, yes, it would need the game code to alter the trajectories of the weapons and the other things mentioned before which would use some physics, but I don’t think it would be too big a performance hit, after a bit of thought, it is just a simple formula to add the wind vector.

The temperature content parm would be pretty much the same, just holding one variable though. Unless you wanted to add in humidity, air pressure, or even sunlight warmth :huh:
Maybe it would be better to just have a wind content parm rather than an atmosphere one.

Edit:

Maybe an oxygen shader could be introduced aswell…
It could get activated when the mapper decides using either a script mover or the stuff in appendix A of the shader manual. For example, if you somehow got locked in an airtight bank vault, you would get the oxygen to decrease to a certain point and then you would get suffocated slowly.

(P.S. Does anyone else find that when they reply in the quick reply box they often lose what they’ve written because in the meantime of typing their reply they have been logged out? I’m learning, and copying to clipboard my post before I click submit, but I still sometimes lose things…)


(SCDS_reyalP) #4

mods can add or redefine surface/content params. The infrastructure is already in place to deal with that. ISTR some documentation of this included with radiant.

deformvertexes is done in the engine AFAIK, so can’t be changed by the compiler.


(Mr_Tickles) #5

Ahhh, thanks. I haven’t got any experience with the coding for the mods and haven’t looked at the released code yet, but was just wondering if mods can be created to be used in conjunction with other mods… so for example, someone could create these possible extra shaders (apart from the deformvertexes) and release these as extras so other people could use them with or without their own mods?


(Mr_Tickles) #6

Ummm, just wondering, is there such a thing as an anti-water shader, reason I ask is because if wanted to have section of underwater as dry, for some kind of underwater room, it would be easier to use than creating 6 water blocks to surround the room.

Also, if you wanted to move a submarine with the inside of the sub dry, it would be far, far easier to have an “anti-water” mover rather than moving and stretching the surrounding water blocks.


(Mr_Tickles) #7

I was just thinking about getting caught in foliage. Is there a shader which has content parms such that it slows or hinders the players movement?

Also, would it be possible to apply a number of textures to one surface via the shader? Reason being is it would be nice to be able to overlay differently alpha blended textures with different values of tcmod’s without having to create a number of brushes. :slight_smile:


(ratty redemption) #8

regarding your last post, Im guessing if there where some friction type content property, that would work in a similar way to slick shaders but Im not aware of any slow friction ones in rtcw, maybe et has some?

the 2nd part is easy, just have a multi stage shader with different tcmods, rgbgens and or alpha properties, but if volume blending is used it would affect most stages that use a blendfunc.

although we can inverse the output of the volume blending if need be using alphagen oneminusvertex, or use an alphagen const value, like 50% which iirc overrides the volume blending for that stage.


(Mr_Tickles) #9

Thanks Ratty! :slight_smile:
Cool, more stuff to play around with on the the bledning front :smiley:

Yeah, I don’t think there is a friction content parm, would be good if there was one though…


(ratty redemption) #10

cool and agreed :slight_smile:


(Mr_Tickles) #11

Ummm, was just looking through something, and I was wondering if it is possible with the alpha channel, not only to have the black parts as see through, but what if the white parts could clip bullets aswell? I was thinking along the lines of fences, because you can shoot through the gaps, but not through the construction pieces of the fence… I don’t know, maybe this would take too much of a performance hit, but I think it would be worth a try. Would probably only need a small alphaFunc keyword in there.


(ratty redemption) #12

its another good idea but I dont think its currently possible, although a mod might be able to make the changes to the engines physics… I am just guessing, so if I`m wrong, reyalP or ydnar when he gets back, should be able to confirm if this is possible.


(Mr_Tickles) #13

Hmmm, all you would really need is to apply some kind of clipping to the alpha channel, or, apply the alpha channel to some type of clipping. This would be great as fire fights between these varying alpha channels would be hit and miss (pardon the pun), they would be really good for some improvised cover.

Also, is there some kind of surfaceparm that can reduce the damage of a bullet flying through it? For example, if you had a thin wooden plank, or a piece of plywood, once the bullet passes through, it’s speed would be reduced with a reduction in damage aswell. Also, don’t forget about water… this also severely reduces the range of bullets. Maybe there is something which reduces the range aswell as the damage?

Maybe both of these could be combined so that if the alpha channel was totally white, then the bullets would be blocked, toatally black, bullets would fly straight through. If the alpha channel was grey, the bullet would have half it’s range remaining and do half as much damage.

Imagine if you had a large sheet of paper. What if you shoot it? It will get ripped to shreds! Could there be a shader which alters it’s alphamap in this case, using the above bullet alphamap aswell, so that when you shoot it in certain places, it becomes ripped at that part? i.e. the alphamap becomes black at that part. True, you would get the stacked destructibles problem then, but again, that would be a problem that the mapper would have to sort out.
Or… maybe, someone could create a small AI script so that if there was a line of black from edge of the alphamap to the other, the lower portion could float to the ground as a script mover with some deformVertexes on it :wink:

Hmmm, was just thinking, would panzer rockets explode as soon as they hit the surface of water? At that speed the surface is bound to give a sufficient impact to detonate it. If so, could there be a clip for this? Not a clip missile though as that clips players aswell.


(SCDS_reyalP) #14

The server doesn’t even load the textures, so q3map would have to decompose it into into brushes, and add those to the BSP. Needless to say, this could have a big CPU impact when it came time to do physics (on both the client and server). Better to just build with brushwork in the first place. You could use the texture as a guide, and just add clip brushes…

Plenty of good ideas, but I’m pretty sure most of us could come up with neat stuff all day long. Implementing it is the hard part.

edit:
There are other ways that could be done, but they would be even more complex, and require significant changes to the game code (or ideally, the engine code).