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

Draft: remap implementation in std library #1955

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Sparsh-N
Copy link
Contributor

@Sparsh-N Sparsh-N commented Mar 9, 2025

Description

Work in progress PR. Aims to resolve #1899

Some questions I have regarding implementing it are:

  • To be added to the std lib, do I need to write for all types (normal, point, color)? Currently only have float and vectors types written.
  • In case the combination of mix/unmix is used to implement remap (which I've seen is elsewhere, at least in many gamedev tutorials where remap is a lerp(inverseLerp()) call), does a separate unmix method need to be added to OSL or is there a easier way to complete it?
  • From the documentation of efit in VEX https://www.sidefx.com/docs/houdini/vex/functions/efit.html, there's also a method signature which takes in 2 floats as the bounds for the 'new' range, while taking vectors for all other values. Should this also be added to the std library (or documentation)?

Thanks!

Tests

Haven't added any tests currently, will add more once the method is complete. To my understanding the tests would be in
/testsuite/remap-reg folder?

Checklist:

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable.
  • I have ensured that the change is tested somewhere in the testsuite (adding new test cases if necessary).
  • My code follows the prevailing code style of this project. If I haven't
    already run clang-format v17 before submitting, I definitely will look at
    the CI test that runs clang-format and fix anything that it highlights as
    being nonconforming.

Signed-off-by: Sparsh-N <[email protected]>
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

Successfully merging this pull request may close these issues.

remap function included in the std library
1 participant