The Lambda Lab
/
projects
/
raymarcher.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Test scene for mandel pigment.
[raymarcher.git]
/
Operations.lua
diff --git
a/Operations.lua
b/Operations.lua
index
d606d39
..
617916d
100644
(file)
--- a/
Operations.lua
+++ b/
Operations.lua
@@
-13,8
+13,20
@@
local function union(s1, s2)
end
end
end
end
+local function diff(s1, s2)
+ return function (location)
+ local p1 = s1(location)
+ local p2 = s2(location)
+
+ return {dist = math.max(p1.dist, -p2.dist),
+ texture = p1.texture}
+ end
+end
+
+
Operations = {
Operations = {
- union = union
+ union = union,
+ diff = diff
}
return Operations
}
return Operations