custom shader in target_smoke entity


(badong) #1

I’m trying to use a custom shader for a target_smoke but somehow the smoke sprites generated by the entity come out very small.
What controls the size of these sprites and how do I make them “normal” size.


(shazmax) #2

I’m working on something like this myself - not sure if this is what your looking for but might as well take a look.
http://user.tninet.se/~fzo823r/smoke.htm


(badong) #3

thanks but that site doesn’t seem to have anything on what I’m trying to do(exept that one line at the very end which really doesn’t say much).
I’m not sure what shader the smoke entity uses for the default smoke types. I think it uses the shaders on _unsorted.shader, but those shaders look quite weird and I’m not exactly sure how to manipulate them.
Any word from SD on how this stuff works is greatly apprechiated.


(shazmax) #4

Then maybe have a look at this - http://www.splashdamage.com/index.php?name=pnPHPbb2&file=viewtopic&t=7527&highlight=targetsmoke

Or PM some of those guyz, they might be able to help you.


(ratty redemption) #5

guys, if you find the et tex image that looks like it`s the smoke particle, then do a windows find files, containing the name of the image, in the main\scripts folder, and it should help you find the smoke shader.

Id do this myself, only I dont have et yet.

@shazmax, if you do find the original shader, then see if you can copy and rename it, and use those ent key values that Drakir was telling us about, if that works then we can start to play around with rgbgens


(shazmax) #6

I got the values - and I think the smoke effects might be in the _unsorted.shader in the pak0.pk3 file - don’t have time now but I’ll look into it later


(shazmax) #7

I looked around…I figured out how to put a different texture in there but as for the smoke image itself and shader I’m not sure what it is


(badong) #8

I think you misanderstood what my problem is.
I know how to make the smoke entity use a different shader/texture for the smoke.
The problem is that the sprites generated by it are too small. Maybe this picture will help ilustrate the issue.
What i want to know is how to scale the sprites generated.


(ratty redemption) #9

understood, and shazmax found the same problem when he tried custom shaders, if you do find a solution, please post it in here, likewise we`ll do the same, if we find it first.


(chavo_one) #10

What are the dimensions of the image you are using for your shader? I’m guessing that it is smaller than the image size of the default smoke texture. If your texture is not 128x128, then my guess is it will not behave exactly as the default smoke does.

If this isn’t the case, perhaps this system is just broken. BTW, when I looked at the code it appears SD intended to include mustard gas in the game!


(chavo_one) #11

nevermind. I went through the code, and if I’m reading this right, you’ll never get this to work right unless you make a mod. If you set “shader” equal to anything, then the size of the particles get hard-coded with the following parameters:
start_size=8
end_size=32
no particle rotation


(ratty redemption) #12

@chavo, thanx for telling us this, but the news sucks :frowning:


(ratty redemption) #13

although, could we still rotate tex in the shader using a tcmod? …if so, then maybe even these small particles might add a nice effect to my autosprite water mist :slight_smile:


(MadJack) #14

I guess you’re onto something there ratty… tcMod’ing it to a “big” rotation/disturbance/etc could give some interesting results.


(ratty redemption) #15

cool, I`ll eventually get round to trying this, but at least it sounds possible :slight_smile:

in the mean time if any one else wants to try a rotating, deforming shader based on my water mist one, here is it

textures/_ratty_water/waterfall_spray1
{
 qer_editorimage textures/_ratty_terrain/image08.tga
 deformvertexes autosprite
 surfaceparm nolightmap
 surfaceparm nonsolid
 surfaceparm trans
 cull disable
 {
  clampmap textures/_ratty_terrain/image08.tga
  alphagen wave sin 0.8 0.2 0 0.8
  tcmod stretch sin 1 0.1 0.1 1
  tcmod rotate 400
  blendfunc gl_src_alpha gl_one 
 }
}

the image08.tga is a large 128x128 particle which looks like a splattered water droplet, and has an alpha channel of about 70% translucency.

once Ive finished repainting my other water tex, Ill be releasing some source files of my waterfall, containing the mist, flowing alpha mod volume water etc.