Jump to content
The Dark Mod Forums

Lamp Glass


Springheel

Recommended Posts

I have looked through the changes and logs, but there are too many things changed and nothing looks suspicious for a white flash change. It might be a code change (so nothing in the diffs or logs would show).

 

One thing is evident, tho, the SVN commit messages are usually not descriptive enough (my fault, too) and in some cases, way too many changes have been comitted together.

"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

  • Replies 147
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

It might be 12765 (changes to light materials). However, what I don't understand are changes like this:

 

-//	 diffusemap	  textures/darkmod/window/lamp_glass_unlit
-	   {
-			   map			 models/darkmod/props/textures/lamp_glass_unlit
-			   red			 0.6
-			   green   0.6
-			   blue    0.63
-	   }
-
+	   diffusemap	  textures/darkmod/window/lamp_glass_unlit

 

Does that drastically alter the appearance (from 60% brightness to 100% brightness)??

"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

That was a fix to correct Badcogg's change to that texture. When you just have a stage with "map" like that it works like an additive blend. In the above case, it was making unlit lamps glow in the dark.

Link to comment
Share on other sites

Ah ok, one of the "finer details" of the material shaders :)

"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

It might be a code change (so nothing in the diffs or logs would show).

 

Is there a way to find the src rev that was used to build an exe and/or dll? I thought revs were appearing during one of the startup screens, but I don't remember which one; will look next time I start TDM.

Link to comment
Share on other sites

It's printed to the console, but the change was done only recently by me.

"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

I've tracked the white flash to 12766.

 

The only items changed in that rev are the exe and the windows dll. The console shows that the src rev is 5392.

 

Rev 12765, which does not show the flash, shows a src rev of 5362.

 

Since the only items changed between 12765 and 12766 are the exe and dll, the problem must lie in one or both of those, not in any of the definition/material/sound files.

 

Src revs 5362->5392 span a period from 4/1 to 4/15.

 

Looking at the commits during that period, I see a wad of changes made by Serps to the renderer, along with his comment that "this might break things, let me know".

 

Anyhoo, here's the set of commits that are suspect. We need to get Serps to join this thread. I'll ping him with a PM.

 

Flash.txt

Link to comment
Share on other sites

Very good work, grayman!

 

We probably can ignore revisions 5389 .. 5392 (they only remove unsused code and vars). That leaves us with 5362 -> 5389. Still a lot. Buit 5383 seems lkely to be the culprit.

 

Now how do we find out which of the changes in it causes the white flash!? :ph34r:

 

Edit: We are lucky that the console already shows the revision for both changes.

"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

Hey,

 

Only got my line fixed this evening. Before it died I was busy bisecting the versions, which you seem to have done. Thanks!

 

I'll take a look into it on Friday evening when I have some time.

 

Also, the bug might not actually be a bug, we may very well have been using an undefined behaviour, looking at the material files there is a good chance that they were dividing by 0/null; which is possible with shaders and can return some very strange stuff. It's why I use the bitwise operators in the water shaders to check if a value is value before trying to use it. Quite possible that I borked getting the sound amplitude or whatever the var is in the case (I was looking at the _snd shaders).

 

You will also notice the way that DR reacts to these materials - _snd in specific is to show the pure-white (well, pure-ish, there's some colour that gets blended in on the fringe).

Link to comment
Share on other sites

Looking at the commits during that period, I see a wad of changes made by Serps to the renderer, along with his comment that "this might break things, let me know".

 

This sounds like a likely candidate for the flush visportal problem as well. Would be worth checking if that happens before that update.

Link to comment
Share on other sites

Ok, taking a closer look at the white light issue now that the portals are sorted.

 

Using a render from just after the gpl merge (i.e before me), the problem with the flash is actually still there. The only difference is that it's not white, its black and as such doesnt show up. While that may sound better, it only hides the real problem (that problem leads to anything from rooms with no working lights to entire maps or out-right crashes in the case of some of the d3 materials). Its likely that its been broken since the gpl merger, or on one of the lower level changes elsewhere.

 

I have a few other suspects to look at now.

Link to comment
Share on other sites

Yup - the problem lies on the TDM side of things, the amplitude is being worked out correctly, except that there is no referenceSound for the lights (tested with a manually made one). I take it that this is a result of the recent light entity changes. There seems to be some generic refLight, which might have been getting used.

 

If someone else wants to look into that, otherwise I'll check it out in a few days - I don't really know what happens on that side of things.

Link to comment
Share on other sites

The light entity does not know which soundshader it should be using for sound's value, as such it falls back to 0.0; which will give it that pure white. The default could be changed to 1.0 which would give you the 'normal' brightness, but it'd still flash in this case.

 

Pretty much, the combo entity needs to tell the light what sound it should be using, at the moment it doesn't seem to be - or at least not as it is created.

Link to comment
Share on other sites

Is this as case for light entities with materials that specifiy a sound modulation only?

 

What kind of sond shader should it even use?

 

And would the code falling back to 0.5 be better in this case (no white or black flash but instead medium light level)

"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

The light entity does not know which soundshader it should be using for sound's value

 

The entities have a "s_shader" spawnarg that points to "light_flicker_104". Isn't that the right spawarg?

Link to comment
Share on other sites

TDM doesn't have a sound shader nmed light_flicker_104, maybe it is a D3 shader (that somehow does not get loaded because we overwrite a file where it is defined?) It might be that never has worked, just that one didn't see the black flash, but the white flash is apparent.

"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

maybe it is a D3 shader

 

It is a D3 shader. There are a sequence of about seven or eight of them, and they all seem to be designed specifically for light flickers.

 

But I'm still trying to understand what problem Serp is referring to. In what sense is this true:

Pretty much, the combo entity needs to tell the light what sound it should be using, at the moment it doesn't seem to be
Link to comment
Share on other sites

Is this as case for light entities with materials that specifiy a sound modulation only?

Or multiply/divide by the keyword 'sound'.

 

What kind of sond shader should it even use?

void idMaterial::EvaluateRegisters( float *registers, const float shaderParms[MAX_ENTITY_SHADER_PARMS],
								const viewDef_t *view, idSoundEmitter *soundEmitter ) const {
...
case OP_TYPE_SOUND:
if ( soundEmitter ) {
	registers[op->c] = soundEmitter->CurrentAmplitude();
} else {
	registers[op->c] = 0.0f;
}
...

On maps with combo light entities, like the electric lights or candles, the soundEmitter is never != NULL.

 

And would the code falling back to 0.5 be better in this case (no white or black flash but instead medium light level)

Yes and no, considering the problem can easily go unnoticed - I think the warning has a valid reason.

Link to comment
Share on other sites

Sorry, Serp, but I still don't understand what you mean by this:

 

the combo entity needs to tell the light what sound it should be using, at the moment it doesn't seem to be

 

Is this a problem with the code? Or is "s_shader" not the correct shader to be using?

Link to comment
Share on other sites

I have applied a temp fix for this. The lights will show as normally lit, so there might still be a small flash, but for 1.08 testing so long, it should be way less distracting.

 

I'll look closer into the entity stuff when I get some time - I want to get the screenshot fix done ASAP, sort of forgot to finish the patch once I started looking at this/lg.

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

      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 )
      · 2 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
       
      · 5 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
    • 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
×
×
  • Create New...