Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

Especially the way they interact with lookup tables. https://www.iddevnet.com/doom3/materials.phpintroduces tables by saying, 'In Quake3, you could do all kinds of neat things with sin waves, saw tooth waves, square waves and other types of waves'--but doesn't say what they are.

 

(Edit: by the second 'they' I mean the neat things in all their kinds, not the wave types.)

Edited by VanishedOne

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

ShaderParms, tables, and a handfull of internal variables are used in mathematical expressions. Anywhere in a material shader where a numerical value is used, you can usually substitute it with an expression. Because expressions are evaluated every frame it means you have the ability to animate some aspects of materials.

 

 

  • time: Forever increasing floating point value that returns the current time in seconds
  • parm0-parm11: Parameters that can be set a number of ways (discussed above)
  • global0-global7: Not used right now
  • fragmentPrograms: Constant that is 1 if ARB fragment programs are available. This is mostly used for disabling a stage by specifying "if ( fragmentPrograms == 1 )"
  • sound: The current sound amplitude of the entity using this material. This is used to create light materials that pulse with the sound.

 

 

A cursory look over the material keywords that accept numerical values will give you an idea of what can be animated. A few examples of properties you could animate would be rotation, scale, translation, shear, brightness, and transparency.

 

Time is used in virtually every expression. It's similar to a frame counter. It starts at zero and increments.

 

Still with me? Good. Here's where we test what you've learned. Here's a stage with an expression...

{
   translate time, time
   map textures/custom/foo.tga
}

What's this doing? Remember, time starts at zero. Then it's one. Then two, three, four, and so on.

 

 

If you said scroll the texture horizontally and vertically you'd be correct.

 

 

Okay. One more example that's a bit more difficult.

{
   translate time * 0.1, time * 2
   map textures/custom/foo.tga
}

 

If you said scroll the texture slowly on the horizontal, and fast on the vertical you'd be correct.

 

 

It helps a great deal if you have a mathematical mind, are familiar with operators like modulo (%), and can graph functions. It's algebra and you're solving for x.

 

Tables are just that. Tables with values in them.

table myNumbers {0.5, 1, 0.5, 1, 0.6, 1, 0.5, 0.8, 0.5, 1, 0.5, 0.6 }

You might use these values to make something flicker...

{
  rgb myNumbers[time]
  map textures/custom/foo.tga
}

In this case, time is the index. It's asking for the value in position zero. Then one, two, and so on.



			
		
  • Like 1
Link to comment
Share on other sites

It helps a great deal if you have a mathematical mind

 

 

I definitely do not. :)

 

But I do understand most of what you posted already...just not how shaderparms fit into that. Are they just floating values that can be added to an entity by a spawnarg somehow?

Link to comment
Share on other sites

It's another set of parameters you can use in your expressions. The difference being that these parameters are set at the entity level.

 

For example, say you have two lights that pulse using the same material shader. If "time" is the only parameter you're using to control the effect, then all lights using that shader will pulse in sync. Maybe you don't want that. So you use a shaderparm to act as an offset. Maybe the original expression looks kinda like this...

sinTable[time * 0.01]

You'd modify it like this...

sinTable[(time + parm1) * 0.01]

And now in DR you can simply add a parm1 key/value pair to every light using this material to change it's offset.

  • Like 1
Link to comment
Share on other sites

Just to check, though: are you looking at the inherited spawnargs list, and still seeing the old setting greyed out?

No, it changes to black (as it should I guess).

 

I haven't noticed that problem, but I always hit Enter to set a spawnarg. You can see whether it's changed if you look at the panel above (you might need to turn off inherited spawnargs).

Maybe that was the problem. I always looked at the gray value and it didn't seem to change...

 

Thanks!

Link to comment
Share on other sites

Shaderparms can also be used conditionally, as in this example from id's page:

models/weapons/soulcube/soulcube3fx
{
    noSelfShadow
    translucent
    noShadows
    {
        if ( parm7 > 3 )
        blend add
        map models/weapons/soulcube/soulcube3fx
        rgb scTable[ time * .5 ] 
    }
}

The entire blend add stage gets drawn or not drawn depending on the current value of parm7.

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

It's another set of parameters you can use in your expressions. The difference being that these parameters are set at the entity level.

 

For example, say you have two lights that pulse using the same material shader. If "time" is the only parameter you're using to control the effect, then all lights using that shader will pulse in sync. Maybe you don't want that. So you use a shaderparm to act as an offset. Maybe the original expression looks kinda like this...

 

sinTable[time * 0.01]
You'd modify it like this...

sinTable[(time + parm1) * 0.01]
And now in DR you can simply add a parm1 key/value pair to every light using this material to change it's offset.

That's helpful, thanks.

Link to comment
Share on other sites

Hello, I am back with another mapping question:

I made some readables, but I want some of them not to be frobable (for instance, on a bulletin board, the player should be able to read 2 of them, not all 10).

How do I accomplish this? (I tried using 'frobable 0' but that makes the readable blank)

Link to comment
Share on other sites

I never noticed this before, but you're right. Apparently being frobable tells the renderer to paint the text even when the readable isn't highlighted. Not frobable = no text painting.

 

Since the renderer will paint the text even when the readable isn't highlighted, there's nothing that forces the player to frob the readable in order to read the text. He could just stand there and read it.

 

Is that unacceptable?

Link to comment
Share on other sites

Since the renderer will paint the text even when the readable isn't highlighted, there's nothing that forces the player to frob the readable in order to read the text. He could just stand there and read it.

 

 

That's the way it is designed to work. The play can potentially use the spyglass to read things from a distance.

 

I think what he's trying to do is make a readable that can ONLY be read from a distance, not frobbed and read close-up.

Link to comment
Share on other sites

 

I think what he's trying to do is make a readable that can ONLY be read from a distance, not frobbed and read close-up.

 

Correct. But even if it's frobable, and lights up when the player is near it, it's still readable w/o the player actually frobbing it.

 

I guess we need to hear why this isn't acceptable.

Link to comment
Share on other sites

From left to right: what I drew in Krita, what I see after saving as TGA and loading in IrfanView, and what I see when loading the TGA in an in-game GUI.

banding.png

I can fix the brightness in IrfanView, but is there anything that can be done about the colour banding in the right-hand image?

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

On my monitor, there's banding in the original too. Less visible than in #3, but that could be due to the brightness difference. Subtle colour gradients don't look good brightened. #2 looks like the bands have been hidden by oversaturation. The gradient has been lost too, but that could just be in the screenshot given that some detail is back in #3 -- hard to tell without seeing what #3 looks like when the brightness is lowered again. You can tweak the rgb channels in the material shader.

Link to comment
Share on other sites

Does anyone know a way to force textures to be opaque in DR? The "forceOpaque" keyword is used by dmap, but it seems it doesn't work in DR.

 

I tried changing portalsky to be a blended material to fix a problem with it drawing over lit decals, but now it's semi-transparent in DR which might drive people nuts.

Link to comment
Share on other sites

now it's semi-transparent in DR which might drive people nuts.

 

 

I noticed and I'm not a fan. :P

 

Not sure how DR handles it though.

Link to comment
Share on other sites

The editor image is opaque (well, a normal image), but DR is rendering it 50% transparent presumably because its only diffuse stage is a blend stage.

 

I could try hacking it around, but I wondered if there was an editor_ keyword or some other good way to fix it.

Link to comment
Share on other sites

Does anyone know of an FM that has water flow? i'm trying to get it to work myself but it just doesn't work.. I've created the func_forceshield as per the wikis recommendation but it just doesn't flow... as soon as the player hits the water flow it just slowly moves them.

 

Thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recent Status Updates

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 5 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...