Jump to content
The Dark Mod Forums

Spectrum Light Map


nbohr1more

Recommended Posts

So after considering the benefits of the spectrum keyword I had a little brainstorm...

 

What if only one stage in a material could be set to noDynamicInteractions and that stage would only be affected by lights of the same spectrum. Now my hypothetical "near infinite" light overlap scenario would work.

 

I will try to test this myself but here is the material shader concept:

 


add the following: 

textures/your_desired_editor_texture_folder/your_texture_name 

{

// Use one of the predefined surface types like stone, glass, wood stone // or use this: 
// surfaceType 15 
// and make the first word in the description below your texture type, 
// like so: 
// description "foliage" (This is a grass texture) description "Add here a little description of your texture" 

qer_editorimage textures/your_file_folder/your_texture_name_ed 

bumpmap textures/your_file_folder/your_texture_name_local 

diffusemap textures/your_file_folder/your_texture_name 

specularmap textures/your_file_folder/your_texture_name_s 

// This is the code for the "Light Map" stage 

{ 

diffusemap textures/your_file_folder/your_texture_name 

spectrum 3 // Only lights with spectrum 3 affect this stage

noDynamicInteractions // The lighting for this stage will not change once the map loads 

} 

// The following two blocks are required for the ambient shading: 
// TDM Ambient Method Related 
{ 
if (global5 == 1) blend add 
map textures/your_file_folder/your_texture_name 
scale 1, 1 
red global2 
green global3 
blue global4 
} 

{ 

if (global5 == 2) blend add 
program ambientEnvironment.vfp
vertexParm 0 1, 1, 1, 1 // UV Scales for Diffuse and Bump 
vertexParm 1 1, 1, 1, 1 // (X,Y) UV Scale for specular 
vertexParm 2 global2, global3, global4, 1 
fragmentMap 0 cubeMap env/gen1 
fragmentMap 1 textures/your_file_folder/your_texture_name_local //Bump 
fragmentMap 2 textures/your_file_folder/your_texture_name //Diffuse 
fragmentMap 3 _black // Specular 

} 
} 

Edited by nbohr1more

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Yeah, I was hoping for a loophole there:

 

	

// options to override surface shader flags (replace with material parameters?)

bool noSelfShadow; 	// cast shadows onto other objects,but not self

bool noShadow;				// no shadow at all

bool noDynamicInteractions; // see below

// don't create any light / shadow interaction

// the level load is completed. This is a performance hack

// for the gigantic outdoor meshes in the monorail map, so

// all the lights in the moving monorail don't touch the meshes

 

Now that I've read more clearly, these appear to be bulldozer "ignore anything in the material definition and follow my orders" type attributes.

 

I thought that "surface shader flag" might be another name for "stage keyword".

 

Oh well... back to the drawing-board...

Edited by nbohr1more

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

  • 3 weeks later...

As a variation of this concept, I saw an old Doom3world thread where it was suggested that two brushes with the same materials (except the spectrum variable) could be placed in the same location.

 

Then these questions were posed but never clearly resolved:

 

1) Would the materials z-fight?

2) Would one of the spectrum materials render as black rather than being invisible?

 

Another thing that was brought-up was the behavior of Spectrum light volumes...

 

According to one account, Spectrum will only illuminate the edge of the volume while leaving objects inside the volume un-lit?

 

:unsure:

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

As a variation of this concept, I saw an old Doom3world thread where it was suggested that two brushes with the same materials (except the spectrum variable) could be placed in the same location.

 

I have no idea what effect you are trying to attain with this stuff, it seems rather strange and so round-about that it's unlikely to work :huh:

Link to comment
Share on other sites

A couple of points...

 

  • Lights illuminate.
  • Objects that aren't lit are black.
  • Any two polygons that occupy the same space will exhibit z-fighting.
  • As stated above noDynamicInteractions is an entity spawn argument, not a material shader keyword.
  • You really need to find some way to tinker around despite your wife and children.

Link to comment
Share on other sites

In the case of "Spectrum" lit objects this is certainly confusing... :unsure:

 

Id Dev's site claims that "Spectrum" is for "Invisible Writing" that is only seen when lit by a light of the same spectrum.

 

The only way that would work if the material is black until lit is if you left an area conspicuously black and the writing (etc) was within that black void... Hardly a useful characteristic and even more damning of Id for not making "spectrum" a stage specific keyword. :huh:

 

If, however, it works as we would imagine from the description, you would place decals with the writing over a wall and set their material to a specific spectrum. The letters would be invisible instead of black and only show when a spectrum light hit them. Another analogy would be the use of UV light "spectrum" to find blood stains at a murder scene in some cheesy crime drama. If the stains are black then they are already visible.

 

Thanks for your replies. I will certainly be playing with this some more at some point...

Edited by nbohr1more

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

If I remember correctly the "invisible writing" from Doom 3 glowed red. I haven't examined the material shader and corresponding images but I imagine it uses an additive stage and the darker such a stage is the more transparent it is. Spectrum will have a different effect on diffuse, normal, and specular stages.

Link to comment
Share on other sites

If I remember correctly the "invisible writing" from Doom 3 glowed red. I haven't examined the material shader and corresponding images but I imagine it uses an additive stage and the darker such a stage is the more transparent it is. Spectrum will have a different effect on diffuse, normal, and specular stages.

 

I think what nbohr1more was suggesting is that pixels in a spectrum material are either:

 

* not hit by a light, so they render transparent (e.g. not at all)

* hit by a light, so they render colored by that light

 

while you suggested that the first case renders black.

 

I think that both cases would "work" depending on what the material shader says. If the material is additive, then it only adds what is lit by a light (e.g. 0 or nothing if not hit by a spectrum light) and if the material is multiplicative, then it would end up black when not hit by a light.

 

But the only way to find out is to try it :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

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

    • The Black Arrow

      Hey @nbohr1morehow come the zombies in The Dark Mod don't have a "resurrection" mechanic to it, similar to how Thief has it?
      They're quite a weak creature as of right now, it's merely a walking corpse that slashes you, making attacking them to kill them an actual strategy.
      Would be better if they had some cool mechanism to it that truly makes them a danger, such as the resurrection idea itself.
      · 2 replies
    • Ansome

      Query: when was the last time a zombie in a video game was unnerving or scary to you? I'm chipping away at my anniversary submission and I've been trying to gather opinions on the subject. I'm perfectly capable of lighting them well, changing their sfx, and creating effective ambience, but I'm worried that zombies at their core are just too overdone to be an effective payoff to the tension I'm creating.
      · 4 replies
    • nbohr1more

      The Lieutenant 3 is out! Congrats Frost_Salamander! ( raising awareness )
      · 2 replies
    • OrbWeaver

      Has anyone had any luck with textures from Polyhaven? Their OpenEXR normal maps seem too washed out and give incorrect shading in the engine.
      · 5 replies
    • datiswous

      I tried to upscale the TDM logo video. First try:

      briefing_video.mp4 You can test it ingame by making a copy of the core tdm_gui.mtr and place it in your-tdm-root/materials/ , then edit line 249 of that file into the location where you placed the new briefing.mp4 file.
      What I did was I extracted all the image files, then used Upscayl to upscale the images using General photo (Real-Esrgan) upscale setting and then turn it back into a video.
      I might have to crop it a bit, the logo looks smaller on screen (or maybe it's actually better this way?). My video editor turned it into a 16:9 video, which I think overal looks better than 1:1 video of original.
      · 1 reply
×
×
  • Create New...