Shadows casted on unlit polygons

If a model uses CastAndReceive shadow mode, the unlit polygons get to be too dark, because the shadow map is rendered on top of them. The artefact is demonstrated on the screenshots. On the first one, the model with the dark polys uses CastAndReceive shadow mode, whereas on the other one it only uses Cast. Obviously, if it also receives shadows, the unlit polygons get darker.

Is there a way to go around it? As in not to cast shadows on unlit polygons? At the moment my workaround is to split the model into multiple parts in blender and then set them up in the scene composer so that some only receive and some only cast. But this is not possible to do for a slightly more complex scene thou.

Cheers

Edit: hope the images get displayed now

This has bugged me for a while, shadows also do no stop specular highlights from being generated. I’m playing around with a solution that integrates the shadow calculations with the Lighting.j3md material. I will drop a quick post in here when I have made enough progress.

@anyone else looking into solutions, getting the shadow renderer to ignore back faces relative to the light position might be a good start.

1 Like

No real solution around this, right now.
@thetoucher is working on a way to make the shadow pass rendered in the lighting pass…Maybe we could subtract the lighting intensity to the shadow intensity to avoid this.

@nehon so how do games generally solve this in the way they render dynamic shadows?

@thetoucher could you please share your current progress and your plan regarding your solution? I’d be more than willing to help out and contribute, because the issue makes the shadows more or less unusable for a dynamic scene.

Cheers

If you mean other JME games, they don’t and cope with it.
If you mean other games as games in the game industry there are too many solutions to list here, other shadowing systems and things that I’m probably not aware of.

The two ways of getting it better in JME are : what @thetoucher mentioned and deferred lighting that is on my todo list.

@hudy said: @thetoucher could you please share your current progress and your plan regarding your solution? I'd be more than willing to help out and contribute, because the issue makes the shadows more or less unusable for a dynamic scene.

So far all I have is proof of concept, with with the direct light shadow filter system integrated with the Lighting material (looks to be marginally faster and the final quality looks much higher(no double darkening), but this may totally shit the bed when it comes to more complex scenes)… no code worth sharing yet, it’s only a mornings work. My plan is to continue talks with the core team to figure out how best to move forward with this, I hope have these talks tomorrow and in the coming days. This is my current project of focus so it will have my full attention until we have either a solution, or a reason why it can’t work… so imagine we will come up with a solution in the next week or so.

Cheers for your offer to help out, I won’t need any assistance with my stuff as of now. For the mean time, I recommend you don’t split up your models any more (as this is highly inefficient, a massive pain in the ass to do, and wont achieve anything in a dynamic environment as you mentioned). My suggestion would be keep on with the rest of your project and see where we get with this in a couple of weeks… If there is no progress made, bug @nehon, he loves it when people ask him for things, I can give you his personal contact details if he doesn’t answer you on the forums.

@thetoucher said: bug @nehon, he loves it when people ask him for things, I can give you his personal contact details if he doesn't answer you on the forums.
LOL "I can also sink needles beneath his finger nails".

Quick update, there is some working code floating around as a rough test case …
(2x 4 split PSSM @ 1024, note the overlapping shadows and no double darkening on back faces). The best way to work this into the core is currently being discussed by some of the developers.

@nehon will be more than happy to explain how it all works, and is looking forward helping anyone who wants to implement it into their own project =)

@thetoucher and @nehon

Guys, any update on this? If you are short on time while working on this, I am still willing to give a hand; haven’t been able to do much on my own so far (could use some guidance from an experienced JME developer).

There is also the problem of shadows having the same intensity while the light fades out. This applies for rendering point light or spot light shadows that have a range. As the light fades away, the shadow should lose its intensity. Do you think that what you are doing is going to solve this as well?

Cheers