r3f-postprocessing

Implements post-processing effects for React Three Fiber scenes using @react-three/postprocessing.

1|Updated Aug 20, 2023
One-click install
npx skills add https://github.com/imanlangaran/mini-projects --skill r3f-postprocessing-imanlangaran
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r3f-postprocessing
Source: https://github.com/imanlangaran/mini-projects/tree/main/react/three-gsap/.claude/skills/r3f-postprocessing
Command: npx skills add https://github.com/imanlangaran/mini-projects --skill r3f-postprocessing-imanlangaran

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @react-three/postprocessing, postprocessing, @react-three/fiber, three.

What problem does it solve? Adding visual effects like bloom, depth of field, and color grading to React Three Fiber scenes requires knowing the correct EffectComposer setup, effect parameters, and integration patterns, which this Skill provides as ready-to-use code. ## Core Features & Use Cases - Built-in Effects: Configure Bloom, DepthOfField, Vignette, SSAO, ChromaticAberration, Glitch, ToneMapping, and more with documented props. - Custom Effects: Create custom screen-space shaders by extending the postprocessing Effect class or using wrapEffect. - Advanced Patterns: Implement selective bloom, animated effects via useFrame, conditional effect toggling, and performance tuning for mobile. - Use Case: You want glowing neon objects in a 3D product showcase; use the selective Bloom pattern with emissive materials and toneMapped={false} to make only chosen meshes glow. ## Quick Start Add a bloom and vignette effect to my React Three Fiber scene using @react-three/postprocessing.

Frequently Asked Questions about r3f-postprocessing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add bloom effect in React Three Fiber?

Wrap your scene content in an EffectComposer from @react-three/postprocessing and add a Bloom component with luminanceThreshold and intensity props. For objects to glow, use emissive materials with emissiveIntensity above 1 and set toneMapped={false}.

How to make only specific objects glow with selective bloom?

Use the Selection and Select components from @react-three/postprocessing. Wrap the EffectComposer and meshes in a Selection, then wrap only the meshes that should bloom in Select enabled, leaving other meshes unaffected.

Does @react-three/postprocessing work with custom shaders?

Yes, create a class extending Effect from the postprocessing library with a fragment shader implementing mainImage, then render it via a primitive or wrapEffect inside EffectComposer. Uniforms can be animated in the update method.

Should I use SMAA or MSAA with EffectComposer?

Use the multisampling prop on EffectComposer for MSAA, or set multisampling={0} and add an SMAA or FXAA effect as the last effect in the chain. Combining both wastes performance, so pick one anti-aliasing approach.

Why is my post-processing slow on mobile devices?

Each effect adds GPU rendering overhead, and high multisampling values compound the cost. Reduce multisampling, disable mipmapBlur on Bloom, lower SSAO samples, and conditionally disable expensive effects on mobile user agents.