Shadows vs transparent objects

Great job!



The “flickering issuse” might be z-fighting as described here. For me, the following line gives good results.

[java]

material.getAdditionalRenderState().setPolyOffset(-0.1f, -0.1f);

[/java]

@normen said:
Just run the test chooser..?

What if I want to look at the code? Or, god forbid, some tests are RED and I can't launch the test chooser. :P
1 Like
@madjack said:
What if I want to look at the code? Or, god forbid, some tests are RED and I can't launch the test chooser. :P


:P I guess I never ever used the test launcher XD
Probably because I always want to see the code I execute, so I understand what it does and not only how it looks.

The test chooser shows the full class name, so after entering the name Momoko told you once you know which class it is…

(Well since I use eclipse I just do OpenType and type the name and thats it. I guess something similar exist for netbeans as well)

((Btw how come we both are usually the most active at this time here, while we both should probably be sleeping already XD))

@EmpirePhoenix said:
((Btw how come we both are usually the most active at this time here, while we both should probably be sleeping already XD))

idk, german jme times seem to be 2 to 4hrs off ;)

The flickering issue on the sphere is just PCM filtering. It’s also on the ground but it’s more noticeable when the slope of the object is parallel to the light direction. that’s why you see it most on the sphere

Take Skyrim for example, push the shadow quality to the max…and you’ll still notice this flickering.

There is no easy solution to this, or maybe adding some randomness to the filtering pattern.

Or push filtering to PCF8, but the shadows are less precise.



@madjack I will point to the test next time, I’m indeed using the testLauncher and it never occur to me that one would not use it :smiley:

One question: Is there a way to improve the performance of shadows atm?

My fps drops down from 1150 to 320 when I acticvate shadows only with a fistful of models on my terrain.

Small Textures need high filtering → Slow

Large Textures → Slow

Small Textures + low filtering → Ugly

@ogerlord said:
One question: Is there a way to improve the performance of shadows atm?

Yeah, get a good graphics card and enable hardware compare mode. Also whats to improve with 320 fps? oO

HardWare Compare Mode doesnt render shadows which a model casts on another model…


Also whats to improve with 320 fps? oO

My Computer is relative new and I am scared of performace problems when I add more content. (Besides everyone would flame me: Yeah your game is too slow because you have choosen java....java is not for 3d games...noob.. etc.... ) ;)

Well its always a tradeoff, thats why some games decide to lock the framerate as low as 30fps. This is the GPU getting to its limits, has nothing to do with java. Shadows are computing intense shit, simple as that.

Shadows are slow, there are leads to enhance the performance, and actually spent my week end on this…with no avail.

Also, batching can help on big scenes.

@ogerlord said:
One question: Is there a way to improve the performance of shadows atm?


Realtime shadows is a hard and expensive (compute intense) problem to solve, that's why game developers often bakes light and shadows from static lights into textures (lightmaps) offline.

@kwando about that, is there any material with a shadow map variable ? or ambient occlusion baked map?



Also the current PSSMRenderer can i use it for baking shadow maps?

@Setekh said:
@kwando about that, is there any material with a shadow map variable ? or ambient occlusion baked map?

Also the current PSSMRenderer can i use it for baking shadow maps?


As far as I know you can't bake any lightmaps inside jME, unless you build a lightmap baker yourself. But when you have light maps you can use them with the Lighting material. Most high end 3d studio application could be used to bake light maps. I have not baked any lightmaps myself but I'm familiar with how they work.

Some of the commerical engines have lightmap baking builtin, I think.

Thanks, just wanted a confirmation :slight_smile:

I confirm, no baking right now in JME all is real time.

Baking shadows could be possible in the engine, but IMO you’ll have a far better shadow quality baking them with Blender or Max…



There are plenty of use cases where static shadows are better (baked into a lightmap) : your light is static and a fair amount of objects in the scene are static.

You can also mix dynamic shadows for dynamic objects and baked light maps for static objects.

Newest nightly got rid of the shader error :slight_smile:

1 Like

Cool! Thanks Normen on this one

@nehon said:
Cool! Thanks Normen on this one

:?