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

    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • 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.
      · 7 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
×
×
  • Create New...