shawn0326 / zen-3d

JavaScript 3D library.
MIT License
196 stars 24 forks source link

Not an issue, curiosity about this shadertoy #18

Closed VanderSP closed 3 years ago

VanderSP commented 3 years ago

Hi Shawn! we´re doing tests in nativescript using zen-3d also!

actually i tested custompass, but maybe not working yet, so im in communication of the ns canvas creator all days...

but if it fixes custom pass... i would like to ask you a curiosity

this kind of effect would be too hard on mobile? or it´s a kind of nice and lightweight thing? seems beautifull god rays thing

https://www.shadertoy.com/view/XsKGRW

this runs on zen?

VanderSP commented 3 years ago

have u ever run across this guy? seems a interesting post fx for three... maybe some cool things that´s possible to leverage in zen?

changing topic, how is going the particle system? zen3d already got one?

shawn0326 commented 3 years ago

this kind of effect would be too hard on mobile? or it´s a kind of nice and lightweight thing? seems beautifull god rays thing

This shader is a bit complicated, but as a post-processing of the screen space, it should be able to run on high-performance mobile phones.

this runs on zen?

yes, I think it should work with ShaderPostPass (like custompass examples)

how is going the particle system? zen3d already got one?

zen-3d only contains basic rendering functions, just like three.js. So I think the particle system may not be a module that zen-3d needs to implement. Of course, it is possible to implement a particle system based on zen-3d (perhaps in another Libraries).

VanderSP commented 3 years ago

Nice Thanks Shawn!

Your Sky is much lighter than threejs one and it´s the same! and threejs after r117 started to use pmren generator and they leave it broken even in examples thumbnail, all white thing

ah last thing, we in nativescript canvas, got envmap working like when capturing from skybox to create reflexions in glass for example...

but skybox for cache background like in sky example, seems to capture it just one side of cube, a bit broken... I know that´s not your business, im just saying because Im helping the guy that polyfilled the dom and canvas to webgl in native :D

shawn0326 commented 3 years ago

but skybox for cache background like in sky example, seems to capture it just one side of cube, a bit broken... I know that´s not your business, im just saying because Im helping the guy that polyfilled the dom and canvas to webgl in native :D

In zen3d, the SkyBox is a node and must be in the same position as the camera to be rendered correctly ( generally for simplicity, SkyBox is often added to the camera ), so before render by EnvironmentMapPass, need to put the SkyBox in the same position as EnvironmentMapPass.position I guess the problem may be here. Also note that if scene.matrixAutoUpdate is turned off, remember to call scene.updateMatrix() after SkyBox moved.