JDKnite188 Posted July 17, 2003 Share Posted July 17, 2003 I know that JO does not have an available beam shader. Where can I access a beam shader for use in my map? Link to comment Share on other sites More sharing options...
wedge2211 Posted July 17, 2003 Share Posted July 17, 2003 You can make a beam shader easily enough in PhotoShop with the gradient tool. If you want an explanation of that, ask, I won't do it if you don't have PhotoShop. You could try asking the author of another map for permission to use THEIR beam shader. Since the things are so common, I can't see why they'd refuse. Try Dad*Mad's Snow Winterpack or rgoer's Chapel of the Ysalarami, for instance. Link to comment Share on other sites More sharing options...
Shotokan Posted July 18, 2003 Share Posted July 18, 2003 How do you make a beam in Photoshop? I have it, but I'm not quite familiar with that gradiant thing... Link to comment Share on other sites More sharing options...
wedge2211 Posted July 18, 2003 Share Posted July 18, 2003 Okay, create an image for the beam. It doesn't have to be big, but long and skinny works best, so try 64 x 256 or 32 x 512 or something like that. The taller the image, the longer the beam will be before it fades acording to these directions. With the gradient tool selected, pick whatever color you want for your beam as the foreground color and black as the background color. In the tool options, pick "Foreground --> Background." Now click on the very bottom of the image, hold SHIFT, and drag up to the very top of the image. This will create a gradient perpendicular to the line you made, that starts with the foreground color where you first clicked, and fades to the background color where you let go. (Note I have PhotoShop 5, and I don't feel like shelling out $700, so if anything changed this might not be correct for later versions.) When you make yourself a shader code, add the line "blendfunc add" in the block where you map the texture. For a "dust in the air" effect, you can also add "tcMod scroll 0.1 0" Link to comment Share on other sites More sharing options...
rgoer Posted July 18, 2003 Share Posted July 18, 2003 Just in case you are still lost (even though, in my opinion, Wedge nailed it with his last post), here's something I had laying around the forums: Originally posted by rgoer By the way, when I say "yourmap" I'm speaking metasyntactically for whatever the name of your project is. 1. Create, in Radiant, the actual geometry to which you want to apply this beam shader. Quit Radiant for now. 2. Make yourself a beam shader. This is complicated (if you've never made a shader all by yourself before), so we'll break this step up: a. You'll need (at least) two files for this two work: yourmap.shader, to be placed in the gamedata/base/shaders/ directory, and yourlaser.jpg, to be placed in the gamedata/base/textures/yourmap/ directory. If yourmap.shader doesn't exist, create a blank document in Notepad and save it as (filetype is "all files") yourmap.shader. Here's what to put into it (I'll explain the shader code after):textures/yourmap/yourbeam { surfaceparm trans surfaceparm nomarks surfaceparm nonsolid q3map_nolightmap cull none { map textures/yourmap/yourbeam blendFunc add } } OK, the explanation: "surfaceparm trans" lets the engine know you are making a transparent shader. "surfaceparm nomarks" prevents shot-marks from appearing when you shoot through brushes/patches to which this shader is applied. "surfaceparm nonsolid" allows the player to walk through brushes/patches to which this shader is applied. "q3map_nolightmap" prevents the LIGHT stage of BSP compile from affecting brushes/patches to which this shader is applied (useful for light-source shaders, like your beam). "cull none" tells the engine to draw both sides of any triangle to which this shader is applied--makes transparent objects look a little better. Within the next set of curly braces lies the "meat" of a shader definition: the path/to/image/file and the blendFunc code. You can leave off any file extensions (that is, the file we're about to make will be "yourbeam.jpg" but you don't need the ".jpg" part in the shader def) in the path/to/image/file, and always start your paths as if you were already in the base/ directory. As for the blendFunc code, there is a whole bunch of them, you can read about them in the q3 shader bible. "blendFunc add" just tells the engine that, as far as the "surfaceparm trans" code from before is concerned, we want to add the value of every pixel in yourlaser.jpg to the value of whatever is being drawn "behind" it in the player's line-of-sight. b. Now it's time to make yourbeam.jpg. Fire up Photoshop (or your image creation soft of choice) and create a new document. Size your document at 128 pixels tall by 8 pixels wide. Now, make yourself a vertical gradient that fades from a fairly saturated, high-value red (or whatever color your beam should be) to black. The length of the gradient will be the amount of "fade away" the shader has. If you want your shader to remain fairly consistent, then fade away suddenly at the last minute, concentrate the gradient toward the bottom. When you've got a decent looking gradient, save it to gamedata/base/textures/yourmap/yourbeam.jpg. Voila. 3. One last thing to do before we get into Radiant: edit shaderlist.txt. This file is in gamedata/base/shaders. Edit it, and add "yourmap" to the list. Make sure that "yourmap" is the same name you used for "yourmap.shader" and the textures/yourmap/ directory. 4. Fire Radiant back up. In the textures menu, choose "yourmap" from the list, and apply the "yourbeam" texture to whatever geometry we made in step one. Align the texture so everything looks how you want it, and you should be good to go. Upon compile, that bit of geometry will now become a decent approximate a light-beam. It doesn't cast any light right now, though, so you'll have to use light entities for that, but you can read the q3 shader bible, though, and learn how to make your beam shader cast light all on its own ;^) Link to comment Share on other sites More sharing options...
Shotokan Posted July 19, 2003 Share Posted July 19, 2003 Wow thanks guys. Link to comment Share on other sites More sharing options...
rgoer Posted July 19, 2003 Share Posted July 19, 2003 always happy to help! Link to comment Share on other sites More sharing options...
lauser Posted July 20, 2003 Share Posted July 20, 2003 Did I mention you rock buddy? Wow!! Okay you spelled it out nicely rgoer thanks. I will let you know if my shader worked or not..LOL Link to comment Share on other sites More sharing options...
EK-sama Posted August 1, 2003 Share Posted August 1, 2003 figured since people know wtf is up with the beam shader you might be able to answer this, I require cloned versions of the light/brush combination in my map, complied, played and got this. The light doesn't trigger with the shader, and the brushes "no draw" textures don't seem to work (player goes up and walks on the light LOL) The one I'm looking at was the original I made now it doesn't work now OO. http://irev.net/eksama/shot0351.jpg During the cloning process I didn't move the lights or the brushes in funny ways, just 'space' and positioned. I've even deleted the uncooperative ones and recloned them, got the same effects thx for your help (in advance ^^;; ) ~EKsama Link to comment Share on other sites More sharing options...
rgoer Posted August 1, 2003 Share Posted August 1, 2003 The beam shader appears to have worked just fine--what seems to have happened, here, is that your light entities got stuck inside brushwork. Try moving them out a little bit. Link to comment Share on other sites More sharing options...
unravled Posted August 29, 2003 Share Posted August 29, 2003 I tried this shader and it worked fine, but it has sharp edges like in the screenshot above. is there a way to get a more realistic effect? in other words, diffusing the corners of the beam. Link to comment Share on other sites More sharing options...
Leslie Judge Posted August 30, 2003 Share Posted August 30, 2003 Aha. For example you can modify the pic of the beam to go into black gradiently at the end. This works if the blendFunc in the shader is GL_ONE GL_ONE. Link to comment Share on other sites More sharing options...
rgoer Posted August 30, 2003 Share Posted August 30, 2003 Yeah, here's how "blendFunc GL_ONE GL_ONE" (or "blendFunc add" if you enjoy brevity) works: Here's a simple diagram of your shader code: shader name { surfaceparms and compiler keywords { path to first texture stage bitmap first stage blend function } { path to second texture stage bitmap second stage blend function } { et cetera } } In a given texture stage, if any of those "blend functions" are GL_ONE GL_ONE (or "add"), then it takes the pixel values for the bitmap in that stage's definition and adds them to the pixel value that is already in the frame buffer. Anything you see in the background (beyond something textured with this shader) and any bitmaps from an earlier texture stage from this same shader are already in the frame buffer. So here's how pixel-value addition works: [x y z] = RGB values for pixel "x" which is already in the frame buffer [p q r] = RGB values for corresponding pixel of something mapped with a "blendFunc add" shader [x+p y+q z+r] = Final RGB values drawn by quake. So, if you want your beam to fade out to the point that it is indiscernable from the background (the frame buffer), make sure that the proper portion of its pixels have RGB values of [0 0 0] (that way, [x+p y+q z+r] = [x y z] and you're good to go). Link to comment Share on other sites More sharing options...
EK-sama Posted October 13, 2003 Share Posted October 13, 2003 Originally posted by rgoer ...Try moving them out a little bit. After a long time of procrastination, I *finally* decided to bang my head against Radiant, I moved the light sources out from the brushes and I'm still getting this effect. http://irev.net/eksama/lighterror.jpg One thing the Screenshot can't fully show you is that the brushes/lights that do work, alternate with the ones that don't work. Is there some kind of pattern that I need to be aware of when I'm uitilizing volumetric light? This also affects another source but in a different part of the map, but still using volumetric light, it still makes it a solid and I can mark up the brush, which shouldn't happen according to the shader file I have (beam shader from Matrix_dojo) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.