Comments (4)
Hi @antoniocapelo !
Any PRs are welcome! :D
PostProcessorModule
creates a new renderTarget. Typically there are only inputBuffer
and outputBuffer
, but some advanced passes may require more which makes this thing unpredictable.
What you can do is to try to update them manually with this pseudo-code:
// WARNING: Not tested
const {composer} = app.use('postprocessing');
app.use('resize').addCallback((width, height) => {
// Update buffer sizes
composer.inputBuffer.setSize(width, height);
composer.outputBuffer.setSize(width, height);
});
from whs.js.
Hi @sasha240100, I'm willing to help :D Just point me to the better option, would be it be something inside the codebase? A note on the docs?
What I've done was create a ResponsivePostprocessorModule
(ignore the name) that does the following:
class ResponsiveEffectComposerModule {
manager(manager) {
manager.define('effectComposerResizeHandler');
const resizeModule = manager.use('resize');
this.postprocessorModule = manager.use('postprocessor');
if (!resizeModule) {
throw new Error('ResizeModule dependency not met. Make sure that ResizeModule is listed as a dependecy of App.');
}
if (!this.postprocessorModule) {
throw new Error('PostProcessorModule dependency not met. Make sure that PostProcessorModule is listed as a dependecy of App.');
}
resizeModule.addCallback(this.updateRendererSize.bind(this));
this.updateRendererSize(window.innerWidth, window.innerHeight);
}
updateRendererSize = (windowWidth, windowHeight) => {
this.postprocessorModule.composer.setSize(windowWidth, windowHeight);
}
}
I just add this module to the App's module list (in the correct order) and now when I resize the window everything stays sharp.
Probably what you suggested would be needed if my problem persisted?
from whs.js.
Looks nice and useful! @antoniocapelo You may even drop !resizeModule
checks as they should be already done by ModuleSystem.
We're now working more on https://github.com/WhitestormJS/nextgl , which should become a Three.js replacement for Whitestorm.js v3.x, so most of out time & skills are going to that project. Contact me if you are willing to contribute to that one! :)
from whs.js.
@sasha240100 check your twitter DM's (:
from whs.js.
Related Issues (20)
- should we remove the object from this.children ? HOT 7
- MeshComponent parameter types should extend Component parameter types
- Examples Documentation points to wrong url for WHS.js, causing 404 HOT 1
- [ts] Property 'DefineModule' does not exist HOT 1
- Examples don't Work on Firefox HOT 2
- Dead? HOT 9
- Any way to import a GLTF? HOT 9
- Jpg Textures look solid color HOT 1
- v3.x.x HOT 9
- Network Module Extension HOT 5
- Setup @whs/w-examples
- Setup @whs/w-core
- Better docs on why we need Whitestorm over Three.js? HOT 2
- is this project die? strong to update three.js latest HOT 1
- Examples are broken HOT 5
- Is this still under active development? HOT 7
- Travis build broke HOT 1
- fix whs.io domain HOT 2
- WHS et VUEJS / ELECTRON HOT 1
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 whs.js.