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

mod doesn't exist in hlsl, need to use fmod #7

Merged
merged 1 commit into from
May 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions color/space/hsv2rgb.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ license: |
#ifndef FNC_HSV2RGB
#define FNC_HSV2RGB
float3 hsv2rgb(in float3 hsb) {
float3 rgb = clamp(abs(mod(hsb.x * 6. + float3(0., 4., 2.),
float3 rgb = clamp(abs(fmod(hsb.x * 6. + float3(0., 4., 2.),
6.) - 3.) - 1.,
0.,
1.);
Expand All @@ -25,4 +25,4 @@ float3 hsv2rgb(in float3 hsb) {
float4 hsv2rgb(in float4 hsb) {
return float4(hsv2rgb(hsb.rgb), hsb.a);
}
#endif
#endif