Native Post-Processing Shaders, Advanced Lighting & Physics3D Joints#8343
Native Post-Processing Shaders, Advanced Lighting & Physics3D Joints#8343Carrotstudio0 wants to merge 28 commits into4ian:masterfrom
Conversation
…ulation, gravity, forces, and collisions.
…o the IDE, including source types for autocompletion.
… types, shapes, and properties.
…n and shared data management.
…runtime components.
…izable object cancelable editor, and a 3D physics behavior extension.
…axis properties and X/Y rotation, along with new PointLight and SpotLight components.
…odel object, and 3D lights.
…se3DBehavior, 3D Model object, SpotLight, and Physics3DBehavior.
…, and screen space reflections.
… and physics bounce.
… Ambient Occlusion and Screen Space Reflections.
…Screen Space Reflections, Volumetric Fog, and Bloom.
- Implemented Chromatic Aberration effect with customizable intensity and radial scale. - Added Color Grading effect allowing adjustments for temperature, tint, saturation, contrast, and brightness. - Introduced Flickering Light behavior for dynamic light effects with configurable parameters such as base intensity, flicker speed, strength, fail chance, and off duration. - Enhanced Physics3DEditor with joint editor and ragdoll properties for better 3D object manipulation.
4ian
left a comment
There was a problem hiding this comment.
(note: because the PR seems to be generated by an AI agent, I will respond as I would do for an AI agent, so with minimal additional explanation).
Thanks for this.
The PR is huge so it's hard for a human or an AI agent to handle/review it. Can you:
- Remove all the CMake related files/package-lock.json.
- Split the PR in:
- One for ragdoll/joints for Physics 3D
- One for improvements to 3D effects.
- One for "post processing" shaders.
More generally:
- The smaller the PRs, the higher the chance we can merge them, notably for "obvious small improvements" ones.
- For PRs having an architectural change, it's also better to have them separate so we can review this architectural decision.
Thanks!
| @@ -0,0 +1,70 @@ | |||
| { | |||
There was a problem hiding this comment.
Please clean all these useless files from the PR.
| } | ||
| } | ||
| groupVariablesContainer.clearPersistentUuid(); | ||
| if (typeof groupVariablesContainer.clearPersistentUuid === 'function') { |
There was a problem hiding this comment.
Let's revert all these changes, we don't use typeof and we rely on static typing instead.
| } | ||
| }, | ||
| "node_modules/@babel/core": { | ||
| "version": "7.23.0", |
There was a problem hiding this comment.
Please don't commit any changes to the package-lock.json, thanks!
| destinationPaths.forEach(destinationPath => { | ||
| const outPath = path.join(destinationPath, 'Runtime'); | ||
| const output = shell.exec(`node scripts/build.js --out ${outPath}`, { | ||
| const output = shell.exec(`node scripts/build.js --out "${outPath}"`, { |
There was a problem hiding this comment.
Make a separate PR for this, thank you! :)
|
Additional requirement:
|
|
Thanks for the review. I split the original PR into 3 focused PRs as requested:
Also addressed:
Spotlight redesign (as object + nearest-lights guardrails) will be submitted as a separate PR. |
|
I implemented the spotlight request in a separate PR:
This is kept separate from the other 3 split PRs, as requested. |
|
Adds a new PBRMaterial behavior built on top of THREE.js MeshStandardMaterial/MeshPhysicalMaterial with no renderer-core changes. |
Summary
This PR adds several new native systems to GDevelop's 3D engine. The core additions are fully integrated and production-ready. The Physics3D joints/ragdoll system is also included but can be dropped from this PR if the team prefers to keep the scope focused — the lighting and shader systems are the more complete and tested part of this work.
What Was Added
New Effects Overview
Shader Architecture (SSAO, SSR, DOF, Volumetric Fog and more )
All four screen-space effects share the same consistent pattern:
Structure of each shader:
ShaderPassper effect — no coupling between passes.tDiffuse— current rendered scene colortDepth— scene depth bufferresolution+ camera matrices (primarilyprojectionMatrixInverse)How they are registered in the engine:
gdjs.PixiFiltersTools.registerFilterCreator('Scene3D::...').JsExtensionas official effects with user-configurable properties.addPostProcessingPass(shaderPass).removePostProcessingPass(shaderPass).updatePreRenderupdates all uniforms.Why There Are No Conflicts Between Effects
The pipeline is designed so all effects can be active simultaneously without interference:
PostProcessingSharedResourcesprovides a single unified color + depth capture per layer, rather than each effect rendering independently. This is the key reason stacking multiple effects is safe.WeakMapkeyed by renderer, so each layer's state is fully isolated.SSAO -> RIM -> DOF -> SSR -> FOG -> BLOOM— no ordering conflicts and no unexpected compositing results.Why There Are No Conflicts With Existing Engine Systems
EmptyFilteris returned instead of throwing.radius,samples,intensity, etc.) are clamped to valid ranges to prevent unstable or undefined shader behavior.Lighting Changes
DirectionalLight — CSM + Stabilization
The existing
Scene3D::DirectionalLightwas upgraded with:cascadeSplitLambdacontrolling split distribution.shadowFollowCameratrue/false.4096on high-end GPUs.New parameters:
maxShadowDistance,cascadeSplitLambda,shadowMapSize,shadowFollowLead,shadowFollowCamera.SpotLight & PointLight
Flickering Light Behavior
New behavior attachable to PointLight or SpotLight. Parameters:
baseIntensity,flickerSpeed,flickerStrength,failChance,offDuration. Uses a sine + noise signal, writing intensity viaupdateDoubleParameter.Rim Light
New
Scene3D::RimLighteffect for cinematic character separation. Controllable color, intensity, and falloff.Physics3D (Jolt) — Optional / Droppable
As noted above, this can be excluded if not ready to review. Included:
Physics3D::PulleyJoint— rope-over-pulley constraint withratioandtotalLength.SetJointBreakThresholds/ClearJointBreakThresholds), Reaction force/torque monitoring.Active,Limp,Stiff,Frozen), group controls, humanoid templates (BuildHumanoidRagdoll,BuildHumanoidRagdollFromTag), and a built-in GUI.Files Modified / Added
Extensions/3D/ChromaticAberrationEffect.tsExtensions/3D/ColorGradingEffect.tsExtensions/3D/ToneMappingEffect.tsExtensions/3D/ScreenSpaceReflectionsEffect.tsExtensions/3D/DepthOfFieldEffect.tsExtensions/3D/VolumetricFogEffect.tsExtensions/3D/SSAOEffect.tsExtensions/3D/RimLightEffect.tsExtensions/3D/FlickeringLightBehavior.tsExtensions/3D/DirectionalLight.ts(modified — CSM upgrade)Extensions/3D/JsExtension.js(modified — effect registrations)Extensions/Physics3DBehavior/Physics3DRuntimeBehavior.ts(modified)Extensions/Physics3DBehavior/JsExtension.js(modified)