supreme|sparc Posted June 16, 2003 Share Posted June 16, 2003 I have another question; what color codes are there for lights? Link to comment Share on other sites More sharing options...
tFighterPilot Posted June 16, 2003 Share Posted June 16, 2003 You don't have color codes for light, it has a lot of numbers, you just choose the light and press K to change the color. Link to comment Share on other sites More sharing options...
supreme|sparc Posted June 16, 2003 Author Share Posted June 16, 2003 thanks does any1 know if i can create a laser effect with a spotlight (i.e make the light "visible" all the way to its target) i tried fog but perhaps i did something wrong.. Link to comment Share on other sites More sharing options...
tFighterPilot Posted June 16, 2003 Share Posted June 16, 2003 Are you sure it is possible? Haven't seen that on any level. I don't think the Quake 3 engine can do it. Link to comment Share on other sites More sharing options...
rgoer Posted June 16, 2003 Share Posted June 16, 2003 you can not use a light entity to create any type of "visible" light effect. Here is how I would create a "laser"-type effect: By the way, when I say "yourmap" I'm speaking metasyntactically for whatever the name of your project is. 1. Create a cylendar of tiny radius. This will be your laser beam, so make sure it is long enough to represent the full length of the beam you want. Quit Radiant for now. 2. Make yourself a laser 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/yourlaser { surfaceparm trans surfaceparm nomarks surfaceparm nonsolid q3map_nolightmap cull none { map textures/yourmap/yourlaser 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 laser). "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 "yourlaser.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 yourlaser.jpg. Fire up Photoshop (or your image creation soft of choice) and create a new document. At this point, we are faced with a choice: do you want your laser beam to be look the same all along its length, or do you want it to "fade away" as it gets further from the source? For the time being, I'll pretend you want it to fade, so 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 laser beam should be) to black. The lenght 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/yourlaser.jpg. Voila. Now, if you want a constant, no-fade beam, here's what to do: make a 4 pixels by 4 pixels document and fill it with that same slightly-desaturated, high-value color from before. Save this tiny image to gamedata/base/textures/yourmap/yourlaser.jpg. 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 "yourlaser" texture to that cylendar 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 cylendar will now become a decent approximate a laser beam. It doesn't cast any light right now, though, so you'll have to use light entities. You can read the q3 shader bible, though, and learn how to make your laser beam shader cast light all on its own ;^) Link to comment Share on other sites More sharing options...
supreme|sparc Posted June 16, 2003 Author Share Posted June 16, 2003 thanks alot but theres still one thing i dont get, when i add a texture to an object it usually tiles several times... how could i make the texture start more centered on my object so i dont have to resize the object to make the texture fit.. Link to comment Share on other sites More sharing options...
rgoer Posted June 16, 2003 Share Posted June 16, 2003 If you are applying your texture to a patch/mesh (curve), then the "natural" or "fit" buttons generally work out pretty well. If you want more explicit control (and are using GtkRadiant), select your patch/mesh object and hit shift+s. This brings up the patch/mesh surface inspector, where you can use the horizontal/vertical shift/stretch operations as if your patch/mesh were a "normal" brush. Also, the "set" button works pretty well, even though it annoyingly displays the default values of X = 4.0 and Y = 4.0 every time you hit it, no matter what you set them to be most recently. As far as applying the "yourlaser" texture to the cylendar we made in the little tutorial above, the "fit" button is probably the one you want. Open up the shift+s patch/mesh surface inspector and then just hit the button called "fit." Link to comment Share on other sites More sharing options...
tFighterPilot Posted June 16, 2003 Share Posted June 16, 2003 That's fairly easy. First choose a face,,by Ctrl + Shift + Click on the face. Press s to get into the Surface inspector. Press on the fit button, next to the width and hight text boxes. Link to comment Share on other sites More sharing options...
supreme|sparc Posted June 16, 2003 Author Share Posted June 16, 2003 yeah, it fits now... but somehow the damn texture got mirrored (im making a door this time), how do i get it displayed normally without having to rotate the entire door (thus texturing the wrong side ? Link to comment Share on other sites More sharing options...
wedge2211 Posted June 16, 2003 Share Posted June 16, 2003 Look in the surface inspector at the values for horizontal and vertical stretch. A negative sign (-) in those mirrors the texture across that dimension. To un-mirror it, erase (or add) a negative sign in front of the stretch value. After that, just play with the shift controls to get the texture to line up properly. Link to comment Share on other sites More sharing options...
supreme|sparc Posted June 17, 2003 Author Share Posted June 17, 2003 yep, thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.