heremaps / harp.gl

3D web map rendering engine written in TypeScript using three.js
Apache License 2.0
1.29k stars 197 forks source link

Does harp contain THREE post-processing? #1911

Closed aoyaZY closed 3 years ago

aoyaZY commented 3 years ago

Hey bro , Does harp contain THREE's post-processing? How can I use it? image

nzjony commented 3 years ago

@aoyaZY , check out:

https://www.harp.gl/docs/master/examples/#rendering_post-effects_all.html

https://www.harp.gl/docs/master/examples/#rendering_post-effects_themes.html

aoyaZY commented 3 years ago

@nzjony ,thanks I've seen those example before , those are about the whole scene or theme post-processing I am trying to make custom Object's effects , like single building bloom or something so I need some module like EffectComposer,RenderPass and so on , just like what THREE‘s’ doc said: https://threejs.org/docs/index.html#manual/en/introduction/How-to-use-post-processing Does harp contain these module? Or I need to import by myself ?

Astrak commented 3 years ago

Hard coding the effects in the code was first imagined to quickly benefit the threejs rendering possibilities and allow their tailoring in the themes, with properties known by the framework internally. However it does not allow generation of custom effects, an API would need to be design in that purpose, which would be more reasonable and maintainable as well. It was first planned for demoing and the current solution still surely needs to be matured with respect to the above.

nzjony commented 3 years ago

@aoyaZY , I'm not quite sure I follow, my understanding of post-processing is that it applies some processing to the currently rendered output, so if you wanted some single building / object bloom, you would need to render it separately and then overlay it on the scene. Is that what you mean?

Yes, as mentioned by @Astrak , what we have would need to be extended to make it more customizable, we had another request to add this, see: https://github.com/heremaps/harp.gl/issues/1561

I will ask internally if we can raise the priority to add such an API to expose the EffectComposer etc.

nzjony commented 3 years ago

@aoyaZY , do you mean something like: https://threejs.org/examples/?q=post#webgl_postprocessing_unreal_bloom_selective ?

Or is there another three.js demo which shows what you want to achieve?

nzjony commented 3 years ago

@aoyaZY , we found a ticket that @Astrak had created a while back to add this API, I have linked it.

Unfortunately, we have quite a bit of work on our plates with some internal customers, so it won't be able to be looked at too soon sorry.

Astrak commented 3 years ago

I actually remember a request for such a thing as highlighting a road or a building at the time of the implementation of the post processing. However I think it was not possible to determine the semantics of the result of the raycasting (a building can be several polygons, like for the ones in NY). I don't remember what data this applied to though, and if it could now be possible.

nzjony commented 3 years ago

@Astrak, I think for buildings it would unfortunably not be possible, at least there is no unique ids generated for the buildings in the data that I am currently aware of. Unless the buildings were somehow ID'ed by location. For roads, I guess you have the same problem. BTW, have you seen: https://www.harp.gl/docs/master/examples/#object-picking.html ? It at least shows picking of roads is possible.

aoyaZY commented 3 years ago

@nzjony , yes , that's the example I have seen , you do know what I'm talking about . And I know what you're going through , good luck ! I will try MapRenderingManager , thanks !

nzjony commented 3 years ago

@aoyaZY , thanks. All the best and let us know how you get on. Either re open this issue or create a new one if you have problems / need help.