Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bloomPass on certain objects only #33

Open
fakkeldij opened this issue Feb 18, 2021 · 4 comments
Open

bloomPass on certain objects only #33

fakkeldij opened this issue Feb 18, 2021 · 4 comments

Comments

@fakkeldij
Copy link

fakkeldij commented Feb 18, 2021

Is your feature request related to a problem? Please describe.
As per this example: https://jsfiddle.net/ghe27wmt

  if (elapsed > fpsInterval) {
                              
                                worldGlobe.renderer().autoClear = false;
                                worldGlobe.renderer().clear();
                                worldGlobe.camera().layers.set(1);  // sets camera to layer 1, the object that has bloom is in layer1
                               if (finalComposer !=null ) {finalComposer.render();} // renders the composer of the bloom
                                worldGlobe.renderer().clearDepth();  
                                worldGlobe.camera().layers.set(0);//sets layer 0 (all the other non bloom objects)
                               worldGlobe.renderer().render(worldGlobe.scene(), worldGlobe.camera())

Describe the solution you'd like
I am trying to get the bloomPass to work on a specific camera.layer (to bloom only objects that are set in layer 1) as per the example above. But the bloomEffect does not show.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
I tried adding the unrealBloomPass to worldGlobe.postProcessingComposer() and replacing the above: finalComposer.render() to worldGlobe.postProcessingComposer().render() although no errors, I see no bloom on the object.

Additional context
So the short question is, whether it is somehow possible to only use a postprocessing pass on specific objects using camera layers. And how to go about it.

@vasturiano
Copy link
Owner

@oudekaas I do not know of any way to apply the filter to only parts of the scene / only some objects.

Bloom pass is applied as post-processing as the name implies. This means that its filter effect acts after the scene has been manipulated and as it's rendered to the screen.

From what I gather the snippet you show above uses multiple cameras to separate processed from non-processed objects. If you'd like to build such a setup I would recommend setting up your own scene and add the lower level module three-globe to it. That will give you more flexibility on how the cameras/renderers are setup.

@fakkeldij
Copy link
Author

fakkeldij commented Feb 19, 2021 via email

@vasturiano
Copy link
Owner

@oudekaas three-globe has the exact same functionality regarding the geometries and layer manipulation. In fact, globe.gl uses three-globe as a dependency to calculate all the geometries. The only part that is not readily available there are pointer interactions as that's more related to the scene setup itself.

So, any example available in this repo you should be able to build using three-globe directly.

Also, the globe should appear the same, as long as you keep the correct pixel ratio in the scene.

@fakkeldij
Copy link
Author

fakkeldij commented Feb 19, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants