Giter VIP home page Giter VIP logo

Comments (7)

chfoo avatar chfoo commented on May 25, 2024 2

I ran into this problem too. It doesn't seem possible for the filter to have ever worked before outside of Flash. As of OpenFL 6.0.1, the line

"rcp ft1.z, ft1.z			\n" + // screenZ = -n*f/(d-f)

inFilter3DVDepthOfFFieldTask.hx and Filter3DHDepthOfFFieldTask.hx is translated to

ft1.z = vec4(1) / ft1.z; // rcp

There appears to be an attempt at getting it fixed on openfl/openfl#1613 but it still doesn't work since vect4 is there. I'm not familiar with shaders but based on the translated AGAL rcp instruction, we can just change it to a div instruction to workaround the problem. Since we just want to divide 1/z and luckily it passes 1.0 as a constant in the program data array (in the 12 index as fc3.x), we can substitute the rcp line in the Task files as:

div ft1.z, fc3.x, ft1.z

Doing that change seems to compile without error. One more thing, there is a carryover bug away3d/away3d-core-fp11#566 in the ActionScript source where you must set range in order for it to work. Otherwise it seems to be functional.

from away3d.

jgranick avatar jgranick commented on May 25, 2024 1

Thank you so much for your help!

I believe I have resolved the problem in our AGAL converter, as well as in Away3D (for the default depth value), but if you guys any further feedback or improvements, please send them our way 😀

5d3c3da

from away3d.

jasonsturges avatar jasonsturges commented on May 25, 2024

Josh indicated this may be related to: openfl/openfl@03e9c77

from away3d.

mightymarcus avatar mightymarcus commented on May 25, 2024

Ah ok. But how to fix it?

from away3d.

mightymarcus avatar mightymarcus commented on May 25, 2024

Wow ...

from away3d.

jgranick avatar jgranick commented on May 25, 2024

@chfoo Is there a sensible default we could use in the depth filter, to avoid away3d/away3d-core-fp11#566, do you think?

from away3d.

chfoo avatar chfoo commented on May 25, 2024

The default value is fine, it's just that the original coder forgot to update the constructor in this commit: away3d/away3d-core-fp11@3474bab so _data[8] is incorrect until you do something like filter.range = filter.range.

from away3d.

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.