Jump to content
The Dark Mod Forums

rich_is_bored

Member
  • Posts

    885
  • Joined

  • Last visited

  • Days Won

    18

Posts posted by rich_is_bored

  1. 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
  2. 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
  3. I'm aware of the concerns raised but haven't yet worked out the best solution. It all has to do with the line...

    customPath flies 0.000 0.000 64.000

    I need a different way of distributing particles along the surface of a sphere to eliminate the pattern. I can make it less apparent by pairing down the number of particles or rotating the func_emitter 90 degrees so the poles are at the horizon instead of up/down but neither solution is ideal.

     

    The movement contingent twinkle is a side effect of the particles having no motion. Impart a small amount of motion and they'll twinkle all the time but path they follow is not east to west. You have stars flying towards or away from other stars which looks really odd.

     

    I recall there being a way to create materials that act as particle emitters. That might be the solution here but I'll need to experiment.

  4. Thanks for the direction Steve. I wanted a particle that didn't have a lifetime so I opted to use a ridiculously high value. I've paired it down a bit and it works fine.

     

    I've got a crude test map with everything setup. It can be found here...

     

    https://onedrive.live.com/redir?resid=D6625ED3877C9FB4!1150&authkey=!AJiXvvAkc6DWFps&ithint=file%2cpk4

     

    This is the first file I've shared out in this manner. Just say the word if I need to find another host. Simply drop this file in the root of your darkmod folder, fire up the game, and enter 'map stars' at the console.

     

    You may not notice anything at first unless you move around. That's intentional. I'm also curious to see how this works at resolutions other than 1920x1080. The effect is a product of aliasing, which means resolution may be a factor.

  5. I've tried making a test map but it refuses to load with with the particle effect present. If I delete the entity it loads fine. Bug perhaps?

     

    Until I have more time to troubleshoot the issue, it looks like the only way to view it is to recreate it with editParticles.

  6. Yeah, I was able to create the effect using editParticles but I haven't been able to load it since. I'm assuming it goes in the particles folder then but I haven't done anything with this engine for a good while and I'm rusty.

  7. I had a thought on the way home from work today and figured it was simple enough to test. What if the stars in a skybox were represented not just as pixels in textures but also as pure white quads in a particle effect? If they're sufficiently tiny and move slowly enough it should yield a much more realistic effect.

     

    Well I tried it. It works, it's cheap, and here's the declaration...

    particle starfield {
    	{
    		count				1000
    		material			_white
    		time				1000000.000
    		cycles				0.000
    		bunching			0.000
    		distribution		sphere 64.000 64.000 64.000 
    		direction			cone "90.000" 
    		orientation			view 
    		customPath flies 0.005 0.005 64.000 
    		speed				 "0.000" 
    		size				 "0.050"  to "0.100"
    		aspect				 "1.000" 
    		randomDistribution				1
    		boundsExpansion				0.000
    		fadeIn				0.000
    		fadeOut				0.000
    		fadeIndex				0.000
    		color 				1.000 1.000 1.000 1.000
    		fadeColor 			0.000 0.000 0.000 0.000
    		offset 				0.000 0.000 0.000
    		gravity 			0.000
    	}
    }
    

    To see it for yourself save it as starfield.prt and place it in your darkmod/models folder. Then you can use noclip and testmodel to place it in an existing mission's skybox or use DR. I'd post a video or screenshot but the effect is too subtle to view in any other medium.

    • Like 1
  8. On the router you should have handful of ports labeled LAN and one port labeled WAN. This distinction exists to separate networks. Disable DHCP and wireless, then connect both the modem and computer using the LAN ports.

  9. Direction won't matter. Envshot doesn't take that into consideration. It always shoots north, south, east, west, up and down. You can rotate the cubemap in the material shader if need be.

     

    The only thing is, I'm not reading anything in this thread that suggests the changes required to render false room interiors with cube maps have taken place. I'll try to explain...

     

    Imagine a cube with the faces turned inside out and their respective, north, south, east, west, up, down textures applied. If you were standing inside the cube, at it's center, you'd have a rough approximation of how cube maps currently behave in TDM. Look up, look down, doesn't matter. You're looking at mountains, stars, clouds; things so far off in the distance that knowing where the player is relative to the center of projection isn't important.

     

    But if you want to project rooms through windows, you need to be viewing the cube map from outside the cube. The player isn't forever standing in the center of projection. He's walking by it.

  10. I don't believe in an afterlife. I'm more concerned with the implications of consciousness being nothing more than a product of biochemical and electrical processes. Do we have free will or are we simply choosing which instance of the multiverse we live in with every choice we make? I think I'll wear a blue shirt today... new universe.

  11. Technically all the dirt decals in TDM are "tint maps" minus the diffuse, specular, and normal stages that would make them opaque. It's similar to how you might refer to the additive stage in a material as an emissive map.

     

    A material shader with a tint map might look something like this...

    material textures/whatever
    {
        diffusemap      textures/diffuse.tga
        bumpmap         textures/bumpmap.tga
        specularmap     textures/specular.tga
        {
            blend    filter
            map    textures/tint.tga
        }
    }

    Edit: There's a nice WebGL demo that demonstrates opengl blend modes for those who are curious...

     

    http://threejs.org/examples/webgl_materials_blending_custom.html

    • Like 1
  12. Got a video where an AI does that? All I see is a player crawling around on walls and ceilings.

     

    I like the idea of giving spiders the ability to navigate on all surfaces. It would help operatively differentiate them from other enemies. But that's a huge task when you consider spiders would be the only capable AI and the bar has moved quite a bit since 1999.

     

    Path finding is one huge problem. Natural movement is equally as difficult. I imagine you'd have to gut and replace so much AI and animation related code you might as well tackle flying birds and swimming fish. It's as cool as it is unlikely. Maybe you can talk a computer science department at a university into using TDM as a platform for student research projects.

  13. Missions are packaged as mods with the capacity to override content. Mission authors can put whatever they like in their packages. Not just maps but models, sounds, textures, etc. This makes it necessary to restore everything back to it's original state when the mission is uninstalled or you could be left with residual content. For example, maybe a mission exists where the blackjack is replaced with a magic wand that fires lightning bolts. If you don't restore everything when the mission is uninstalled, then all missions loaded thereafter will feature a lightning wielding thief.

     

    Restarting the engine ensures every mission is loaded from the same state. If you wanted to avoid restarting you'd need to maintain a historical log for every asset in memory so you could safely unload things that are unique and restore things that have been changed.

  14. Those screenshots don't look glass like because you're only handling refraction while reflection is virtually absent. I'm not sure if this is addressable via the current build of the engine but I can say that you need a dynamic cubemap that can be referenced via material shader.

     

    You need to be able to reference an image map like _scratch but this image needs to be an average of cubemaps compiled based on neighboring info_location entities. Half-live 2 does something like this. Each location has a cubemap associated with it. As you approach one or the other the neighboring environment maps are weighted into an average. If you get really fancy you can even apply parallax effects to make the reflection appear more true to life.

     

    The only downside to this approach is the cubemap is static. If you turn lights on/off that status will not be reflected in the cubemap. No Ai will be reflected. No effects. No nothing. You could probably account for this but it would incur a performance penalty. All in all it's good enough without those extra details but we could add them as time marches forward.

  15. There are two possible causes to the smoothing issue; vertex smoothing or disconnected polygons. Make sure shading is set to smooth on a per object basis and try removing doubles to merge any overlapping vertices. Outside of that if the shading issues persist than it has to be a problem with exporting.

  16. In missions where an objective prohibits it, the shortsword is useless. I don't fault people for coming to that conclusion. If we wanted to avoid that misconception we wouldn't give the player items we don't want them to use.

  17. There are a lot of usability issues with GIMP that keep me from making the jump. Layer boundries are a good example. Why does the end user care what size a layer is? Just expand the layer size as I paint outside it. It's unnecessarily complicated. Then there are features from Photoshop that I miss like layer groups, adjustment layers, proper color modes and yes the text editing tools in GIMP suck.

     

    I end up using an collection of apps for whatever they do best. Inkscape for vector work. Mischief for sketching. I haven't settled on something for photo editing.

×
×
  • Create New...