Comments (4)
- thanks for letting us know, docs are still young, will fix it
- same, if you want you can fix the example by forking & updating and we will fork that and use it in the docs
- smaa is active by default and it is a convolution effect, try
<EffectComposer smaa={false}>
<Glitch
BTW I opened an issue asking for comments about a storybook or alt form of documentation/examples, if you have suggestions βοΈ
π #14
from react-postprocessing.
there is a bug in the betas, they all ran without smaa (antialeasing, smooth edges). when it comes to effects and how they work, i am a complete novice, i have no idea what a convolution effect is, that message comes from postprocessing. im guessing certain effects cant be mixed with others. in pp you have to create multiple passes in cases like that, in react-pp we have no means for that currently.
i hope this lib will at least show the possibilities so that people that really know what they're doing can help carving it out.
from react-postprocessing.
Any luck with this? I'm running across this with a custom shader.
/**
* https://www.airtightinteractive.com/demos/js/shaders/js/shaders/HorizontalBlurShader.js
*/
const HorizontalBlurShader = {
fragmentShader: `
uniform float strength;
void mainImage(const in vec4 inputColor, const in vec2 uv, out vec4 outputColor) {
vec4 sum = vec4(0.0);
sum += texture2D(inputBuffer, vec2(uv.x - 4.0 * strength, uv.y)) * 0.051;
sum += texture2D(inputBuffer, vec2(uv.x - 3.0 * strength, uv.y)) * 0.0918;
sum += texture2D(inputBuffer, vec2(uv.x - 2.0 * strength, uv.y)) * 0.12245;
sum += texture2D(inputBuffer, vec2(uv.x - 1.0 * strength, uv.y)) * 0.1531;
sum += texture2D(inputBuffer, vec2(uv.x, uv.y)) * 0.1633;
sum += texture2D(inputBuffer, vec2(uv.x + 1.0 * strength, uv.y)) * 0.1531;
sum += texture2D(inputBuffer, vec2(uv.x + 2.0 * strength, uv.y)) * 0.12245;
sum += texture2D(inputBuffer, vec2(uv.x + 3.0 * strength, uv.y)) * 0.0918;
sum += texture2D(inputBuffer, vec2(uv.x + 4.0 * strength, uv.y)) * 0.051;
outputColor = sum;
}`
}
export default HorizontalBlurShader
import * as React from 'react';
import { Uniform } from 'three';
import { Effect, EffectAttribute } from 'postprocessing';
import HorizontalBlurShader from '../shaders/HorizontalBlurShader';
let _uStrength;
export class HorizontalBlurEffect extends Effect {
constructor({ strength = 0.1 } = {}) {
super('HorizontalBlurEffect', HorizontalBlurShader.fragmentShader, {
attributes: EffectAttribute.CONVOLUTION,
uniforms: new Map([['strength', new Uniform(strength)]]),
});
_uStrength = strength;
}
/**
* Updates this effect.
*
* @param {WebGLRenderer} renderer - The renderer.
* @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.
* @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.
*/
update(renderer, inputBuffer, deltaTime) {
this.uniforms.get('strength').value = _uStrength;
}
}
export const HorizontalBlur = React.forwardRef(function HorizontalBlur(
{ strength = 0 },
ref,
) {
const effect = React.useMemo(
() => new HorizontalBlurEffect({ strength }),
[strength],
);
return <primitive ref={ref} object={effect} dispose={null} />;
});
from react-postprocessing.
π This issue has been resolved in version 2.15.2 π
The release is available on:
Your semantic-release bot π¦π
from react-postprocessing.
Related Issues (20)
- HelloοΌHow to display different colors?
- EffectComposer and Typescript
- Next 13+ EffectComposer Import Error HOT 3
- Added the Custom Effect of Sharpeness
- Live demo broken
- Remove yarn, just adds complexity
- "no exported member" errors when using NodeNext module/moduleResolution in TypeScript
- Selection causes endless loop
- DepthOfField issue: white halo around objects when using resolutionScale < 0.5
- Upgrade `postprocessing` dependency to latest HOT 4
- No tone mapping exposure support HOT 3
- ToneMappingMode is not re-exported. This can lead to confusion due to how Typescript handles enums
- Current state of SSR
- Memory leak when switching cameras HOT 2
- Configure SMAA
- Invalid value used as weak map key in postprocessing
- [Bug] - N8AO works incorrectly with adaptiveDpr
- Shockwave on cloned objects HOT 1
- Modify Godrays props
- When using `EffectComposer`and `GizmoViewport`, `GizmoViewport` disappears
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-postprocessing.