Code Monkey home page Code Monkey logo

Comments (2)

dj2 avatar dj2 commented on June 1, 2024

The parser in amber treats all colour values as [0..1] floating point values. So, when it parses the EQ_RGBA 0 1 0 0 it divides each value by 255.f which is why the expected value ends up being 0.003922.

You'll either need to EXPECT on each index that the values are correct, or create a second buffer with the result values and EXPECT with an EQ_BUFFER.

We could potentially add a EQ_URGBA (or some better name) to specify the the RGBA values are [0-255] instead of [0..1] if this comes up a lot.

from amber.

rg3igalia avatar rg3igalia commented on June 1, 2024

Understood, thanks! Reading that, my main complaint is that this is poorly documented. If I'm using UNORM framebuffers and store a 1.0 from the shader, I understand how that ends up being a 255 value in memory, so I can reason why EQ_RGBA may want me to say 255 by reading the documentation. However, it's not evident at all that I cannot apply this operation to UINT framebuffers (the expected value undergoes a floating point division, but the actual value does not), nor is it evident that we need to apply the workarounds you mention. So I ended up being quite lost. 😅

from amber.

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.