Lighting in shadows

Presumably it would tend to wash everything out too - take the image, darken it by X for the shadow and then lighten it by X for the light and you are going to lose detail.

@zarch said: Presumably it would tend to wash everything out too - take the image, darken it by X for the shadow and then lighten it by X for the light and you are going to lose detail.

That part is true. I don’t understand Remy’s part though. The whole point would be to render this after the shadows… that’s why the fact that it’s a post processing filter is nice.

well this is what i’m reading right now: http://http.developer.nvidia.com/GPUGems/gpugems_ch09.html

It doesnt sound like a walk in the park, but it appears to be the solution we are all heading toward.

@nehon

[java]
The OP’s problem is that another light is lighting a shadowed area. In real life the second light contribution would cancel the shadows on the area…. but in a game engine with a forward rendering process and multipass lighting there is no way it can.
Single pass lighting could alleviate the issue, (providing the post shadows are rendered during the lighting pass)……but really all this leads to deferred rendering.
[/java]

I thought some guys did have deferred shading working GitHub - kwando/dmonkey: Deferred Shading for jMonkeyEngine 3, won’t that do?

Any news on this topic? I have the same problem where a second light source lights in shadows and it only makes the texture blend to dark gray-ish like it was color-saturated but still dark. I’d really like this issue to be solved. I was reading earlier on other posts here about Deferred Lighting and I was wondering if there was a fix for the light in shadow problem wether it be by the Deferred Lighting or maybe just an edited version of Lighting.j3md?

@.Ben. said: Any news on this topic? I have the same problem where a second light source lights in shadows and it only makes the texture blend to dark gray-ish like it was color-saturated but still dark. I'd really like this issue to be solved. I was reading earlier on other posts here about Deferred Lighting and I was wondering if there was a fix for the light in shadow problem wether it be by the Deferred Lighting or maybe just an edited version of Lighting.j3md?

The only way I could think of to solve this issue was to compile the shadows prior to applying lights and then alter the final shadow map as lighting was being applied.

With JME’s current shadow rendering & lighting system, I don’t think it is possible to achieve the desired effect.

EDIT: To be more specific, multi-pass lighting has the disadvantage of NOT knowing about other lights in the scene… and the render order is pretty important in this case as well.

  1. Create shadow depth maps and combine them to a single shadow map
  2. Calculate lighting and apply this both to the scene and the shadow map output
  3. Blend the shadow map into the lighted scene.

But I’m wondering something. Since Shadow Filter is a post processor, then it means that it is applied AFTER the lighting, right? So couldn’t we encode a byte or a certain color to flag to the Shadow Filter that this pixel you’re about to darken has light applied on it, so skip it, or EVEN BETTER, it has x% light applied to it, so only apply x% amount of shadow on it?

@.Ben. said: But I'm wondering something. Since Shadow Filter is a post processor, then it means that it is applied AFTER the lighting, right? So couldn't we encode a byte or a certain color to flag to the Shadow Filter that this pixel you're about to darken has light applied on it, so skip it, or EVEN BETTER, it has x% light applied to it, so only apply x% amount of shadow on it?
That would be great in a deferred rendering process....you can't really do that in a forward process.

The solution is to render the shadow while rendering the light, that is in the lighting shader. I think @thetoucher did it once. It’s far from trivial and it would need a big refactoring of the shadow system.

I know this topic is pretty old, but I didn’t want to open a new one.
Is there finally a solution with version 3.1?

I’m currently working on a better solution, didn’t have a lot of time in the last month but I’ll continue with it soon.

3 Likes

Ah, I did read about this, but wasn’t shure whether you are still working on it.
I look fowrard to hearing from your work.

There are a lot of other things to do for my game so fortunately I can switch the shadow issues with other things I have to implement^^

…few days back, i have downloaded and installed projector plug in, and spent some time, playing with it…based on that, i can reconfirm that, this is very simple and elegant solution for this ‘shadow problem’, without using any hacks…works out of box…

Where can I find this plugin?
There is no plugin called projector, at least I can’t find one.

…it is one selected on the provided image…

Hmm, I don’t even have this category.
Is this just available for 3.0?

Info: I do have enabled the jMonkeyEngine SDK User Contributions in the update center

The Projective Texture Mapping plugin appears in the list of plugins of 3.1 here.
And this with the plugin settings that come out of the box of a 3.1 jme sdk installation.
Could be wrong, but I think it comes with the JMonkeyEngine SDK User Contributions (check your settings tab of the plugin panel).

…im running 3.0, and installed this plug in few days back…it works fantastic, and it could be used for so many very cool effects…for your particular case is perfect and even more, not that its fixing your problem, but also, adding new ‘touch and feel’ as you can use specific textures which reassemble car light beam texture…really a must have plug in…

As I wrote befor, I have enabled jMonkeyEngine SDK User Contributions and I am using 3.1.
So I don’t have a clue why this does not work.

I was thinking using this plugin for my missiles leaving traces of explosions on my track… do you know if it’s a good idea, and a not too costly in resources one, aka could be used on android?

Yah, you have the same settings I have. Was mostly answering your question where you were wondering if it was available for 3.1. In case it’s of any help, with the same settings as you, I have a total of 344 plugins available (about 40 more than you).