How to create custom shader for target_smoke


(2Bit) #1

I’ve created a custom smoke graphic (colored smoke) for a target_smoke entity, and added the “shader” key to the entity with a value pointing to my custom shader.

That bit works fine and I see my custom graphic rising from the smoke emitter - but I don’t really know how to emulate all the other things that the standard shader does, like make the smoke twirl and get larger. So my smoke is just an image that rises then fades away. I’ve managed to make it rotate but I’m probably not doing it as it should be done.

I’ve tried to find the original smoke shader in pak0 to copy and learn from but without any luck.

Can anyone tell me where the original shader is, or otherwise what a custom smoke shader should look like? I don’t want to replace the standard smoke graphic, just to be able to add colored smoke to certain smoke emitters on the one map.

Thanks
2Bit


(Pande) #2

try things like

rgbGen wave
tcMod stretch
tcMod turb
tcMod scale
tcMod scroll
tcMod rotate (looks like you have that already?)
any of the deformvertexes


(Zer0Cool) #3

afaik this shaderchanging function for target_smokes doesnt work properly, I always got a thin long smoke when I tried to use it, so I remapshadered the grey and the black one with own to get working ones.
I asked the same question about the original shader some time ago jsut use the search function :wink:


(2Bit) #4

Thanks guys, Pande I’ll try those tcMods, maybe tcMod scale allows for a changing scale? I’ll go see.

Zer0Cool, yup I also get the thin long smoke, but I can’t remap the standard smoke because it will change the definition for the smoke in all the maps on the server - besides I wanted to have some red smoke and some blue smoke at the same time, along with the normal black.

I did try searching before I posted, for things like “target_smoke” and “custom smoke”, but got zero results? I guess if you asked the question some time back then by now someone would have posted the answer if there was one, so you’re probably right that it doesn’t work. Thanks anyway.


(Zer0Cool) #5

seems like i haven’t read your post carefully ^^
this is the thread i ment:
http://splashdamage.com/forums/showthread.php?p=184204#post184204
it contains the both shaders which are used (black/white) but afaik it doesn’t have to do smth with the movement. for own effects i would suggest Particle Studio


(th0rn3) #6

smoke shader is in _unsorted.shader , and it looks like there are routines for a lot of puffs…


(2Bit) #7

Thanks again guys - I tried duplicating the additional smokepuff_b1, b2 etc shaders from _unsorted.shader (thanks th0rn3) and pointing them to my graphics, but the smoke entity didn’t pick them up, it just uses the single smokepuff shader. So I don’t know how to get the smoke entity to use the _b1, _b2 shaders too.

Worst case my special smoke would use just the single graphic - not as good as having 6 variations, but it would do in a pinch :slight_smile:

I appreciate all the help you’ve given, thank you.


(Pande) #8

and there is absolutely NO POSSIBLE WAY of calling your own effect files through an entity?!??!


(Zer0Cool) #9

why does it have to be done with an entity?


(february1792) #10

potiskanje, tako lepo temo dobro delovno mesto


(2Bit) #11

Well I’m using target_smoke, which provides for using a custom shader - you just assign the “shader” key to the shader you want to use, so I pointed it to my own smokepuff. Thing is, there doesn’t seem to be a way to tell it about the other 5 smokepuff shapes you want to use instead of the standard ones.

It seems the smoke_entity knows about the 6 shaders it needs to use, and either cycles through them or chooses randomly when it generates the next puff. When you use a custom shader, it seems to only know about the single puff. I tried reproducing the other 5 puff shaders using the same name, just a different folder, in the hope that the entity would cycle through the names, regardless of the folder. It didn’t.

As I wanted red smoke, I automatically chose a target_smoke entity - it never occurred to me to achieve this another way. I suspect making my own smoke effect would be rather difficult. The target_smoke produces dozens of brushes, one per puff, dynamically changes their size and fades them away. I think I’d rather stick to my single-size red puff than try to reproduce that! :slight_smile:

Thanks again for your thoughts and suggestions.
Regards
2Bit


(Pande) #12

Why not ask a developer? surely there is one kicking around somewhere, probably in the forums for quake wars or something but htere all the same.


(Zer0Cool) #13

The target_smoke produces dozens of brushes, one per puff, dynamically changes their size and fades them away. I think I’d rather stick to my single-size red puff than try to reproduce that!

The program i linked above is easy to handle and generates all needed shaders.

http://freebrief.planetmedalofhonor.gamespy.com/q3a/ps/index.html


(-SSF-Sage) #14

You could check this topic:

http://www.splashdamage.com/forums/showthread.php?t=17528

Also you could pm isbowhten, he has made some cool effects with target_smoke.

Also do rememeber that they can be disabled with cg_wolfparticles 0, which most of the players have.


(2Bit) #15

Thanks for the extra ideas guys, there are some interesting possibilities there, I’ll look into them :slight_smile:

Cheers
2Bit