GithubHelp home page GithubHelp logo

Comments (6)

walbourn avatar walbourn commented on August 17, 2024

The values coming out of the PNG are expressed in float-point numbers which will be 0 to 1. When storing them as UINT or SINT, it's going to result in 0 or 1. If you want the values to range for all the supported integers, that is what UNORM and SNORM do.

from directxtex.

Puxtril avatar Puxtril commented on August 17, 2024

So in this case, it sounds like an issue with PNGs storing data as floats. Is there an input format that works better for this conversion?

from directxtex.

walbourn avatar walbourn commented on August 17, 2024

All image processing in DirectXTex is done with floating-point to take advantage of SIMD operations.

What is it you expect to happen converting a classic 8-bit UNORM image to a 32-bit UINT image?

from directxtex.

Puxtril avatar Puxtril commented on August 17, 2024

I just expected the end result to be similar to UNORM/SNORM conversions, considering the documentation on Microsoft states the underlying storage format for UNORM/UINT are identical (unsigned integer). And since texconv converted without throwing an error, I was confused why end results varied so much. It was a misunderstanding on my part.

I'm using texconv to generate test data for a project I'm working on using a random png I found online. Now I'm just wondering what would be a better source format to use for generating a valid UINT/SINT image.

from directxtex.

walbourn avatar walbourn commented on August 17, 2024

There are special conversion cases for doing to/from UNORM/SNORM formats which are not applied to UINT/SINT. This in large part because UINT/SINT doesn't have any specific meaning in textures: it's just a raw format used by compute shaders.

I'm open to adding some special conversion here, but it's not clear to me what is the logical behavior.

from directxtex.

Puxtril avatar Puxtril commented on August 17, 2024

I don't have any ideas for conversions, as I'm not familiar with UINT/SINT in standard use cases. But now I have a better understanding of how texconv sees those formats (doesn't do any conversion).

I'm fine with closing the issue as my questions have been answered.

from directxtex.

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.