klepto2 Posted October 5, 2024 Share Posted October 5, 2024 This is a small collection of reworked posteffects including: DOF Features: Bokeh Filtering Autofocusing FocusStart and focus Length values SSAO Features: Denoising Temperoal Reprojection More Samples than the original Tonemapping Features: More or less the same as the original, but with more configurable options and usage of the original Kkronos tonemapping Bloom Features: Multipass downsampling and Tentupsampling More natural bloom effect based on this great video: And a completely new (well actually it is based on an early idea from @Josh) Volumetric Lighting effect which can be configured by using the TextureScale.y component of the light to adjust the volumetric intensity for each light. more configuration options will come later. Download: KL_Effects.zip License: MIT As a start the preffered order of posteffects is included in here:KL_Preffered.json As always feedback is always welcome, also ideas for other effects are welcome as well. Please share if it doesn't work for you or if you experience some big performance drops or any other thing which might be related to these Effects. 5 1 Quote Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
Josh Posted November 21, 2024 Share Posted November 21, 2024 Your bloom looks really good in our level. It's exactly what I wanted. I had to set the threshold to 0.5 to get it to appear though. I think in the near future, user-controlled settings will make these type of adjustments easier. 5 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
klepto2 Posted November 21, 2024 Author Share Posted November 21, 2024 Thank you Its nice to see it in action. the default threshold is 1.0 because you normally just want bloom for colors brighter than the normal color range ( < 1.0). this is why you always need to use bloom before you do any tonemapping (normally tonemapping will try to bring the colors back to 0.0 - 1.0 ranges). the auto exposure should come before that. 2 Quote Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
Josh Posted December 9, 2024 Share Posted December 9, 2024 FYI, the black squares the bloom effect would sometimes produce were caused by NAN outputs in the PBR shader, possibly caused by material painting code. I added a check for NAN at the end of the shader and will go back and determine the cause later. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted December 16, 2024 Share Posted December 16, 2024 Actually, I take that back. For some reason, the Prefilter function can return NAN values. I have traced the problem down to the contribution value, calculated after this line: contribution /= max(brightness, 0.00001); My temporary fix is just to check for NAN at the end of the shader and output black if it is found. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted Saturday at 10:18 PM Share Posted Saturday at 10:18 PM I made some modifications to your volumetric lighting shader. I am not sure what this line does, but I commented it out: //if(extras.texturescale.y < 0.000001 && lighttype != LIGHT_DIRECTIONAL) // return vec3(0.0); And then anywhere the dot product is used to discard lighting, you want to comment that out, because each light sample in the air does not have a normal. float dp = dot(lightDir, normal); //if (dp > 0.0f) return vec3(0.0); You probably don't need to use the more expensive 3x3 shadow sampling that shadowSample() performs, so just calling texture() is probably fine, and will be much faster. //attenuation *= shadowSample(sampler2DArrayShadow(WorldShadowMapHandle), shadowCoord).r; attenuation *= texture(sampler2DShadow(shadowmap), shadowCoord).r; Decals in 0.9.7 are implemented as lights, so detect those and discard: const int falloffmode = ((lightflags & ENTITYFLAGS_LIGHT_LINEARFALLOFF) != 0) ? LIGHTFALLOFF_LINEAR : LIGHTFALLOFF_INVERSESQUARE; if ((lightflags & ENTITYFLAGS_LIGHT_STRIP) != 0) lighttype = LIGHT_STRIP; // This needs to come first because the flag is a combination of others else if ((lightflags & ENTITYFLAGS_LIGHT_BOX) != 0) lighttype = LIGHT_BOX; else if ((lightflags & ENTITYFLAGS_LIGHT_DIRECTIONAL) != 0) lighttype = LIGHT_DIRECTIONAL; else if ((lightflags & ENTITYFLAGS_LIGHT_SPOT) != 0) lighttype = LIGHT_SPOT; else if ((lightflags & ENTITYFLAGS_LIGHT_DECAL) != 0) lighttype = LIGHT_DECAL; else if ((lightflags & ENTITYFLAGS_LIGHT_PROBE) != 0) lighttype = LIGHT_PROBE; else lighttype = LIGHT_POINT; if (lighttype == LIGHT_DECAL) return vec3(0); I have made other changes to this code, as I was testing it, and I turned the intensity way up in order to better see the effect: KL_VolumetricLighting.frag I was also able to lower the buffer size to 0.125 and it still looked good to my eyes. This is a very nice effect! Thank you for creating this and releasing it to the community. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.