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

#167 radiometry: shader update #339

Closed
wants to merge 1 commit into from
Closed
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
11 changes: 8 additions & 3 deletions src/PRo3D.Base/Utilities.fs
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,14 @@ module Shader =
let abB : V3d = uniform?abB
let nc = V4d(v.c.X*255.0, v.c.Y*255.0, v.c.Z*255.0, 255.0)

let red = (myTrunc (abR.X + ((nc.X * (abR.Y-abR.X)) / 255.0))) / 255.0
let green = (myTrunc (abG.X + ((nc.Y * (abG.Y-abG.X)) / 255.0))) / 255.0
let blue = (myTrunc (abB.X + ((nc.Z * (abB.Y-abB.X)) / 255.0))) / 255.0
//let red = (myTrunc (abR.X + ((nc.X * (abR.Y-abR.X)) / 255.0))) / 255.0
//let green = (myTrunc (abG.X + ((nc.Y * (abG.Y-abG.X)) / 255.0))) / 255.0
//let blue = (myTrunc (abB.X + ((nc.Z * (abB.Y-abB.X)) / 255.0))) / 255.0

let red = (myTrunc (((nc.X * 255.0) / (abR.Y-abR.X)))) / 255.0
let green = (myTrunc (((nc.Y * 255.0) / (abG.Y-abG.X)))) / 255.0
let blue = (myTrunc (((nc.Z * 255.0) / (abB.Y-abB.X)))) / 255.0

return V4d(red, green, blue, 1.0)
else
return v.c
Expand Down
Loading