Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

texture function and unpremulted RGB output #1917

Open
PieceMaker085 opened this issue Jan 6, 2025 · 0 comments
Open

texture function and unpremulted RGB output #1917

PieceMaker085 opened this issue Jan 6, 2025 · 0 comments

Comments

@PieceMaker085
Copy link

Problem

As a 3ds max user I am going to describe an issue with OSL from a 3ds max perspective, but I have been told that the issue is not with the 3ds max implementation of OSL but the OSL system itself:

Actual behavior: In 3ds max, using OSL to read bitmaps will always produce premultiplied RGB channel output.

Expected behavior: There should be an argument controlling whether to premultipliy RGB channels or not.

Composing materials is very much like compositing in general, and many times you need the raw RGB output unaffected by the alpha. The OSL texture function should contain an argument whether to premultiply the RGB channels or leave them untouched (unpremulted).

Steps to Reproduce

  1. In 3ds max (any version containing OSL) create an OSL node that reads bitmaps (Bitmap Lookup, UberBitmap, etc).
  2. Load a texture file that is clearly unpremultiplied.
  3. Output only the RGB channels into another node and preview the output. The result is always premultiplied, meaning the RGB channels have been multiplied by the alpha even though you only expect the untouched RGB channels.

Versions

Not sure about the version specifics here. All I know is that this issue exists in whatever version of OSL is used by 3ds max 2023, 2024 and 2025.

  • OSL branch/version: n/a
  • OS: n/a
  • C++ compiler: n/a
  • LLVM version: n/a
  • OIIO version: n/a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant