Jump to content
The Dark Mod Forums

Real Translucency Anyone?


rich_is_bored

Recommended Posts

. I also took the liberty of removing the shadow casting mesh.

 

 

Looks cool. But hoepfully you saved it as a new name. Don't want to start removing shadow meshes from models willy-nilly wink.gif

(I know that's not up SVN, but if we get to that point we have to decide where we're going with that.

If that's the plant I made then the shadow mesh is only on the stalks anyway, in which case I woudln't see why it would need removed.)

In fact with the mush light under it the stalk probably should cast shadows.

 

But we can also just make new skins and put nodraw where shadow is.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

Wouldn't it be cheaper to play a video clip (forgot which format Doom 3 uses) of the guard's shadow in the window?

 

Except the video isn't a real guard. If you were getting ready to open a door into a hallway, seeing the guard's shadow walk past the windows would tell you to stop, and when he turned around and you went inside, you should see him. Not to mention if you KO'd him, you wouldn't want the video still playing. (It's still a good idea for areas you can't reach, though. Or maybe you could use S/R to play the video when the guard is in proximity, but still not as accurate as this method.)

  • Like 1

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

Sure the scripting of a GUI would not be as accurate... Plus it's harder to make and orient the video properly.

 

ROQ Technique

 

Pros:

Better performance

Better pre-rendered lighting

More fluid animation

 

Cons:

Less accurate

Harder to make the video and size and position it.

Doesn't quite match the look of the In-Engine method

 

(this is would logically be an extension of the original "speculation")

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

lol, I'm gonna print that today and try it out!

---------

 

Would be cool if the normals could be flipped in mtr somehow. But even having an extra normal map for each window (at least, maybe plants and a few other things) wouldn't be that bad. As it is we don't have that many windows, and half are just color vers with same normal.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

Note the "?" question mark here:

 

Wouldn't it be cheaper to play a video clip (forgot which format Doom 3 uses) of the guard's shadow in the window?

 

That usually denotes that no conclusion has been derived, no? (another question ?)

 

(Although I agree that I occasionally deserve a little heat for my speculations...:laugh: ... Here I'm not so far off as there's an actual wiki...)

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

...badly named keyword...

 

The best example of this practice is the entire 3d modeling and rendering nomenclature "system"! ;)

There is a lot of this throughout the IT world, of course, but nowhere, in my experience as thoroughly systemic as what I see in this area... ... ... ...."normals"... fucksake

 

...

 

Anyway, I had to say that, but what I really wanted to say is:

 

Thanks for the download-able demo, Rich! And the work that went into it.

 

...

 

Less accurate = Entirely inaccurate -- entirely defeating the purpose ;)

"A Rhapsody Of Feigned And Ill-Invented Nonsense" - Thomas Aikenhead, On Theology, ca. 1696

Link to comment
Share on other sites

Looks cool. But hoepfully you saved it as a new name. Don't want to start removing shadow meshes from models willy-nilly wink.gif

(I know that's not up SVN, but if we get to that point we have to decide where we're going with that.

If that's the plant I made then the shadow mesh is only on the stalks anyway, in which case I woudln't see why it would need removed.)

In fact with the mush light under it the stalk probably should cast shadows.

 

But we can also just make new skins and put nodraw where shadow is.

 

The stalks still cast shadows. The mesh I'm referring to was disc shaped and placed in the center of the model. I don't think it was important but I'll put the shadow mesh back in and change it with a skin.

  • Like 1
Link to comment
Share on other sites

Here's a couple of extra screenshots illustrating the two different plants old on Right (dark, conservative and stolid) and the new on the Left (illuminated, progressive and lucid.

 

This one shows off the translucency:

shot00001gx.jpg

 

 

And this one shows the shadowmesh difference:

shot00002ks.jpg

"A Rhapsody Of Feigned And Ill-Invented Nonsense" - Thomas Aikenhead, On Theology, ca. 1696

Link to comment
Share on other sites

I've exhausted all ideas in regards to inverting the blue channel in the material shader. For instance, this works...

 

	// this inverts the entire image and then removes the red and green channels
{
	map	invertcolor(models/darkmod/nature/colortest)
	maskred
	maskgreen
}
// this removes the blue channel and gains the blue channel from the previous stage
{
	map	models/darkmod/nature/colortest
	maskblue
}

 

... until you use it on a diffuse, specular, or bumpmap stage. So that's a no go for those who were asking. You have to invert the blue channel in an image editor.

Link to comment
Share on other sites

Did you try Orbweaver's suggestion using the scale() function ?

 

According to iddevnet, it does scale the RGBA Values of an image.

 

There is also another keyword called "scale" which does UV Scaling, but it is not the same as the scale() image function.

  • Like 1
Link to comment
Share on other sites

hmm, slightly off topic. But shadow meshes on plants and the like kindof suck. It's impossible to get a good shadow and transparent textures like leaves.

And yet do we want to not have shadows? In this case it might be best, I guess authors can always put dark decals under them. Not sure what's up with the blob one either, but I don't think it really helps anymore than the stalks.

 

So while everyone can see the shadow issues, should we keep them on stuff like this?

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

They don't look particularly good in this case. Though I find models often look like they're floating if there's no shadow on the base to indicate where they hit the ground.

Link to comment
Share on other sites

They don't look particularly good in this case. Though I find models often look like they're floating if there's no shadow on the base to indicate where they hit the ground.

 

I have been toying around with the idea of spawning dark blob decals under them to help the illusion:

 

The dark round smut we have is way too dark, but might look good if nly 10% as dark. The "moss patch" is not bad, either, but to pixalete for my taste:

 

post-144-128095019142_thumb.jpg

"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 have been toying around with the idea of spawning dark blob decals under them to help the illusion:

 

The dark round smut we have is way too dark, but might look good if nly 10% as dark. The "moss patch" is not bad, either, but to pixalete for my taste:

 

post-144-128095019142_thumb.jpg

 

Hm, yes, it looks much better with a custom decal, scaled to match the plant size, marked here in red:

 

post-144-128095266878_thumb.jpg

 

I'll check the decal in. As for spawning it automatically under entities, that can surely added with a big of spawnarg parsing and a call to projectdecal :) Somebody please track it or I might forget.

"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

These are my thoughts:

 

1) There is always a natural occlusion so having a fixed blob rather than a dynamic one is fine.

 

2) The moving blob is not worth the performance hit especially compared to adding more foliage which seems to be more of a win for improved visuals???

 

3) If anything, the stalk shadow is really the key to the immersion for the moving shadow unless you are prone or coming up from a sewer-pipe (etc). The blob is kinda nice for it's intended use but doesn't pack the punch that the stalk shadow does.

 

4) It probably wouldn't be worth it to script having all foliage remove the shadow mesh when the light source is below a certain height???

 

 

New one looks great BTW :wub:

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

Did you try Orbweaver's suggestion using the scale() function ?

 

According to iddevnet, it does scale the RGBA Values of an image.

 

I think my original example would not work actually, because it would negate the blue channel (i.e. make it run from 0 to -255), rather than invert it which is what is required. This is one step in the process of inverting, but another addition of 255 is needed, i.e. new_blue = 255 - old_blue.

 

This could perhaps be done by using scale() in conjunction with add(), e.g.

 

map add(fixed/blue/texture, scale(path/to/normal/map, 1, 1, -1, 1))

 

Where fixed/blue/texture is an image with all pixels set to RGB(0, 0, 255).

 

However this would only work if the intermediate processing stages were capable of preserving the negative blue values of the result of the scale() operation, which might not be the case if each map expression's results are clipped to [0, 255].

Link to comment
Share on other sites

There's something very weird going on here. For testing purposes I've created a simple image and shader with one stage like this...

 

It's just a simple shader with one stage here...

 

	{
	map	models/darkmod/nature/colortest
}

 

It produces the expected result...

 

post-1779-128096616398_thumb.jpg

 

So I try to invert the blue channel and see that values are clamped. In the end I settle on this...

 

	{
	map	add(scale(mytexture, 1, 1, 0, 1), scale(invertcolor(mytexture), 0, 0, 1, 0))
}

 

And that produces the expected result...

 

post-1779-128096637096_thumb.jpg

 

So now we need to try this in a bumpmap stage only obviously this isn't a suitable bump map...

 

	{
	blend	bumpmap
	map	add(scale(mytexture, 1, 1, 0, 1), scale(invertcolor(mytexture), 0, 0, 1, 0))
}

 

Now how this looks isn't important. What's important is that when I did this with an actual normal map, something wasn't right. So I revert it back to the way it was and with the very same shader I end up with this...

 

post-1779-128096659587_thumb.jpg

 

How? What? The result should be the same shouldn't it? I think for now I'm going to stick to making inverted normal maps myself.

Edited by rich_is_bored
  • Like 1
Link to comment
Share on other sites

Theoretically, it should be enough to simply do a "scale( normalMap, 1, 1, 0, 1 )" to get an inverted NormalMap.

 

Because the XYZ components in a normal-map are -1.0 to 1.0 encoded in 0-255, a "0" in the blue channel would mean that the Z-Component is set to -1.0 .

 

Of course this is pretty hacky because it doesn't directly invert the true Z component of the base NormalMap, so there could be some visual error.

  • Like 1
Link to comment
Share on other sites

That's not how the scale keyword works. When you scale the blue channel to zero, all blue pixels become zero. It's not inverting the blue channel. It's completely canceling it out.

 

What you're forgetting is that blue channel pixels with a starting intensity of zero need to end up being 1.

Edited by rich_is_bored
  • Like 1
Link to comment
Share on other sites

As i said, its not inverting the Z-Component, it's setting it to -1.0 ( because the Blue Channel will be 0, the interaction file decodes it to -1.0 ), which pretty much means that the normal is pointing "opposite" to the surface.

 

As far as i know, the image-functions actually create texture-copies in memory, which are then used by the game - you can see this when using the listImages console-command.

 

I did a local test and it actually looks like it inverts the normal-map, might post some images later.

 

Edit:

normalInvert.jpg

 

What you're forgetting is that blue channel pixels with a starting intensity of zero need to end up being 1.

 

Why ?

 

Do you mean that the whole normal needs to be of unit-length ?

 

It's true that setting the Z-Component ( Blue Channel ) to fully -1.0 will likely denormalize the data some, which can give some visual error - altho the extent of the error will largely depend on the base normal-map itself.

  • Like 1
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

      I was playing Skyrim, got bored fast. Got back to The Dark Mod just for one mission, played "Somewhere above the City" which is not really a great mission but still good, as in above-average.
      My biggest regret is living in this country, where there's a heat wave, I am sweating at 20c and I really wish for temperatures below 5c.
      · 10 replies
    • Skaruts

      Is there something wrong with the forums lately, or is it my browser? I've been having trouble formatting posts, and just now I couldn't format anything at all.
      I'm using Vivaldi.
      Usually I have to: select text, click bold, nothing happens, select again, click bold, then it works. 
      Same for other stuff, like creating spoilers, bullet points, links. Nothing works the first time. 
      · 1 reply
    • STiFU

      Back from a spontaneous 1-week trip to Lanzarote with wife and son. I hope beta testing has been going well...
      · 1 reply
    • datiswous

      Whenever I eat fried chicken these days I think of this scene in The Black Mage..

      · 1 reply
    • Mortem Desino

      Even though I've been absent a long while, I still find myself dreamily wishing for the free time to do TDM mission development. When working on new research projects I'll find myself involuntarily thinking, "hee hee this could be a fun texture or readable or bit of map architecture." Or I find myself absentmindedly responding out loud to odd noises with a drunkguard-like "must've been rats!"
      · 3 replies
×
×
  • Create New...