Giter Site home page Giter Site logo

Shadowmap on ios about expo-three HOT 6 CLOSED

expo avatar expo commented on May 4, 2024
Shadowmap on ios

from expo-three.

Comments (6)

EvanBacon avatar EvanBacon commented on May 4, 2024 5

lol figured it out... just add this line before building the renderer, works on both platforms:

gl.createRenderbuffer = (() => ({}));

https://snack.expo.io/@bacon/three-shadows
img_0096

from expo-three.

EvanBacon avatar EvanBacon commented on May 4, 2024

This problem came in SDK 25 when we shifted to using the native iOS framebuffer. I haven't tested to see if this was fixed in 26 - where we added support for OpenGL-ES 3 / WebGL 2.0.

from expo-three.

SvenJonsson avatar SvenJonsson commented on May 4, 2024

I have the same problem at SDK 26, tried downgrading to expo SDK 24 and then SDK 23 but the issue remained to me. Can you confirm? @EvanBacon

ios shadowmap

from expo-three.

EvanBacon avatar EvanBacon commented on May 4, 2024

@SvenJonsson unfortunately EXGL versions work a little differently than the rest of Expo. EXGL is C++ that is used across both android and iOS, then bridged through the respective platforms, so downgrading doesn't work the same.
I'll take another stab at this tonight.

from expo-three.

bberak avatar bberak commented on May 4, 2024

Hi @EvanBacon and @oosmoxiecode,

Did you find anything fishing going on with the z-depth/buffer after applying this fix?

Specifically, I'm finding the z-order gets messed up when using this fix and the EffectComposer with at least one shader pass.

Here is what my app looks like without any shader passes being applied. Notice the orange box gets rendered behind the blue platform when it falls.

correct-z-depth

Here is the same code with an additional sepia shader pass added to the effect composer. Notice that the box gets rendered incorrectly in front of the platform when it falls.

incorrect-z-depth

Removing the gl.createRenderbuffer = (() => ({})); line fixes the z-depth issue, but it causes other problems with shadows and some other shaders down the line.

I've tried this on both Expo SDK 27 and Expo SDK 31 - I get the same results.

Thanks in advance for any ideas/clues - and many thanks for all your work.

from expo-three.

tsapeta avatar tsapeta commented on May 4, 2024

Hey guys, sorry for late reaction, but this issue comes like a boomerang so I investigated it more now 😄
My guess is that it's a duplicate of expo/expo#7502, so please see my comment there: expo/expo#7502 (comment)

If anyone is still working on it and can let me know whether the workaround works I'd be very grateful 🙏

EDIT: Of course gl.createRenderbuffer = (() => ({})); workaround is no longer valid, please use only the one from the comment mentioned above.

from expo-three.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.