Art, code and miscellaneous experiments from Demoscene Passivist related in some way to JOGL. For more take a look at www.jogamp.org
My latest and also last attempt in “shadow mapping” for a while: “Variance Shadow Mapping”. I definitely need a vacation from shadows. The routine uses chebyshev probabilist prediction (mean and variance) to approximate a shadow penumbra. The intention was to work around the massive performance hit of “Percentage Closer Filtering”, but to maintain or even surpass PCF quality wise, but I’m not quite happy with the result of this routine. The generated softshadows have a lot of really “strange” artifacts, though I can’t find any serious flaw in the implementation. Anyway here’s the setup code: GL3_ShadowMapping_VarianceShadowMapping.java and the corresponding (multipass) shaders: .vs/.vs/.vs .fs/.fs/.fs
Lately the tides of war aka “shadow mapping” turned in my favor and I achieved another stage win by successfully implementing “Percentage Closer Filtering Soft-Shadows” (PCF-SS). The routine is quite foreward. It takes several samples from a depth texture (transformed to light pov) filter kernel and averages them. The result is some kind of “penumbra zone” wich is an attenuation of the aliasing. The bigger the kernel, the bigger the penumbra, the softer the shadows. The depth texture convolution may kill ur GPU but will result in visually soft shadows. Full sourcecode can be found on Github: GL3_ShadowMapping_PercentageCloserFiltering.java Shaders: No shaders this time as they are dynamically generated in the Java code.
As my struggle with shadows continues I achieved a stage win by migrating my fixed function pipeline depth texture shadow mapping routine to a completely GLSL based version. This “raw” shadow mapping routine main purpose is to provide a code base for more advanced shadowmapping techniques like PCF (“Percentage Closer Filtering”) and VSM (“Variance Shadow Mapping”). As always full sourcecode on Github: GL3_ShadowMapping.java Shaders:.vs .fs
After implementing fixed function pipeline base shadow mapping it came to my mind that this could be easily used to implement some kind of screen space fake softshadows. First I render the scene geometry as black&white using the fixed function pipeline shadowmapping functionality. After that I convolute the rendered framebuffer with a simple Box Blur thereby softening the shadows. Afterwards I render the normal colored scene and multiply the two framebuffers with a simple fragment shader. The result looks quite cool tho as expected when using simple linear convolution, artifacts arise on geometry edges. Sourcecode: GL2GL3_DepthTextureSoftShadowMapping.java. The corresponding fragement shader wich multiplies the two framebuffers can be found here: .fs
Ported another of my “old” routines to JOGL2. This time a simple fixed function pipeline routine demonstrating shadow mapping as proposed in the paper by Lance Williams in 1978 “Casting curved shadows on curved surfaces”. Full sourcecode can be found on Github: GL2_DepthTextureShadowMapping.java
NIGHTNIGHT by DEDDY