shawn0326 / zen-3d

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

How much effort would be needed to convert ThreeJS Ocean example? #7

Closed xtronoid closed 4 years ago

xtronoid commented 4 years ago

Hi im VanderSP it´s another account i have...

Many thanks by all your effort in this library, i hope our project make the ultra boom we want, so you will be REMEMBERED in many ways!

Just for curiosity, for the sake of a better package size, we are hoping to drop ThreeJS from our project, for that we would need the Water thing... I think it´s on your TODO list...

We loved your Sky Shader port, because the threejs version is 7fps in a J5, but yours hits 38fps

WOW!

I know there´s some things i will still use from ThreeJS: geometry things... but those are just single files that i use then export import in zen via gltf... so the ocean thing would really enable us to drop ThreeJS Package additional heavyness!

shawn0326 commented 4 years ago

Water like shaders / ocean or shaders / ocean2 ?(water is simpler than water2) Anyway, I think it is not difficult to implement these examples, I can do it later if you need.

xtronoid commented 4 years ago

Hi Shawn! Really? i tried by myself but i´ve got trapped on onBeforeRender haha... many functions that i dont know how to convert... and yes the Shaders / Ocean 1 that one with the sky reflecting!

I would be very very very gratefull if you free me from ThreeJS

shawn0326 commented 4 years ago

done.

https://github.com/shawn0326/zen-3d/blob/b960831194005bd026d482789d66dbb2f7483382/examples/lab_ocean.html#L88

https://github.com/shawn0326/zen-3d/blob/b960831194005bd026d482789d66dbb2f7483382/examples/js/objects/Water.js#L10

xtronoid commented 4 years ago

Wow! You´re just awesome!

VanderSP commented 4 years ago

Hi Shawn! i was reading your code just for fun, and i see you did a lot of small conversions! you´re good!

I know it´s boring talking this, but i got so excited to check in my J5, and i was pretty sure that zen water would be faster then three.. because your sky is 38fps on my phone, and threejs one is 7!!! as i already stated you...

but surprisingly, the ocean example i was pretty sure it was faster in zen... i didnt used statsjs on zen, just ran the gitraw hack, but on threejs site there´s a stats at 23fps on my phone and it feels NOTICEABLE FASTER than zen3d in this case!!!... any hint? ... so strange because you got less shader include stuff...

Thanks.

shawn0326 commented 4 years ago

i didnt used statsjs on zen, just ran the gitraw hack, but on threejs site there´s a stats at 23fps on my phone and it feels NOTICEABLE FASTER than zen3d in this case!!!... any hint? ... so strange because you got less shader include stuff...

Set antialias to false will help?

var renderer = new zen3d.Renderer(canvas, { antialias: false });

VanderSP commented 4 years ago

DUH! you are right