Compare commits

12 Commits
Author SHA1 Message Date
josh 64c5abd9b9 Start parsing command line arguments 2026-08-29 12:48:47 -04:00
josh d9dc0b7176 Add Cli struct 2026-08-21 23:15:42 -04:00
josh a567084398 Create cargo binary crate 2026-08-20 16:21:00 -04:00
josh 789061b71f Remove old files 2026-08-20 16:16:46 -04:00
josh 1a5b1292ee Add -j option 2026-06-18 08:40:48 -04:00
josh 36e12d1e90 Render multithreaded locally by default 2026-06-18 08:30:20 -04:00
josh aad02e522d Avoid bison compiler warning for yynerrs 2026-06-15 08:31:15 -04:00
josh 8f09415b37 Remove use of std::binary_function 2026-06-15 08:27:20 -04:00
josh d1b558a554 Fix refptr build warnings 2026-06-15 08:21:50 -04:00
josh acfb883f66 Fix flex build error 2026-06-15 08:20:14 -04:00
josh ede4f6235a Replace freeimage with stb_image 2026-06-15 00:13:13 -04:00
josh 0003c74f3b Use fl LIBS instead of :libfl.a 2026-06-14 23:51:15 -04:00
35 changed files with 88 additions and 1974 deletions

No files matched your search

+1 -6
View File
@@ -1,6 +1 @@
/fart
*.bmp
*.png
/.propane*
/.rscons*
/build/
/target/
Generated
+7
View File
@@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "fart"
version = "0.1.0"
+6
View File
@@ -0,0 +1,6 @@
[package]
name = "fart"
version = "0.1.0"
edition = "2024"
[dependencies]
-7
View File
@@ -1,7 +0,0 @@
.PHONY: all
all:
@./rscons
.PHONY: clean
clean:
@./rscons clean
-29
View File
@@ -1,29 +0,0 @@
configure do
check_d_compiler
end
fart_env = env "fart" do |env|
env["DFLAGS"] += %w[-Werror -O2]
env["D_IMPORT_PATH"] += %w[src]
env.Command("^/src/sceneparser.d", "src/sceneparser.propane",
"CMD" => %w[./propane ${_SOURCES} ${_TARGET}],
"CMD_DESC" => "Generating scene parser")
env.add_build_hook do |builder|
if builder.sources.first =~ /sceneparser\.d/
builder.vars["DFLAGS"] -= %w[-Werror]
end
end
env["sources"] = glob("src/**/*.d") + ["^/src/sceneparser.d"]
env.Program("fart", "${sources}")
end
task "test" do
test_env = fart_env.clone "test" do |env|
env["DFLAGS"] += %w[-funittest]
env.Program("^/farttest", "${sources}")
end
test_env.process
sh test_env.expand("^/farttest")
end
Vendored
-2
View File
@@ -1,2 +0,0 @@
#!/bin/sh
exec ./rscons configure "$@"
Symlink
+1
View File
@@ -0,0 +1 @@
target/debug/fart
-45
View File
@@ -1,45 +0,0 @@
#!/usr/bin/env ruby
# The MIT License (MIT)
#
# Copyright (c) 2010-2023 Josh Holtrop
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
script = File.join(File.dirname(__FILE__), ".propane-1.0.0-5dab693259ff5ad86cc8d86fdd20c552.rb")
unless File.exist?(script)
if File.read(__FILE__, mode: "rb") =~ /^#==>(.*)/
require "zlib"
require "base64"
encoded_compressed = $1
unescaped_compressed = Base64.decode64(encoded_compressed)
inflated = Zlib::Inflate.inflate(unescaped_compressed)
File.open(script, "wb") do |fh|
fh.write(inflated)
end
else
raise "Could not decompress."
end
end
load script
if __F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HpabYIwEGFUeQUZpAVeMA1G4LRNCRdyN5VIlRjpzQXRkJjBqou743IpbfPfKyaBuPIGE6KwZsWemN2daSXcouYZ5PbzeW3v7mEkBXbseF8OrN2A+jfRNu2yyk54yzPp8uxii8YFUvf8KX1dsOnsooatFUiIb7KsNugsvvB9ozucdfOULIlQjzJCahXRXFFL2ZNtVOZNex+7IvtbfHu1dNXe5I7J9MPeXLD635osJrciVWCF7J7qYgxwNL+Ht3N30vt4A3g2GZJj0Nyk9TAHUISqq/UUImtQ8hXTbceGOcJAxuW6qryxgBP9kr0YC9t9YseTkR227G9vK8eVxPAHY8YjvKPXbhZhn4adL1jNCtS1m6TyXzycOYhawozJUnBNwNOAHws22KSy/0MLoggPYJFkRxWSZDVp1Ti7VRMC/lcTo75fDQMoaFBzJyT6drRU7FYKyE01WpMv/XHZy2c8vU6YcjlHti0knRJF3Y5LO9ReSCLr5Vdcj85+AUWEdaPuLWpF/LDfqQOk4GwOfdqhrv39OQMy6JCXelUHkVDbfXTkOX7K3iVVzRW2eegNU6AYOQr2SfpgS6X7XifIiuS1+R+tLDdVlTxQeUi5opF9lhsTeD7ygjGihJ9b7dwTa0nNhK3U+nbn0reEHs7nXCXE9vh+Nuan2/3Mt/zXqYueFHW+NW2HnWHP1YBD3dHFgEPtjfLine truncated
-46
View File
@@ -1,46 +0,0 @@
#!/usr/bin/env ruby
# Copyright (c) 2013-2022 Josh Holtrop
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
script = File.join(File.dirname(__FILE__), ".rscons-3.1.0-4892f95d56c30bbe9aa0c9964062ec5b.rb")
unless File.exist?(script)
if File.read(__FILE__, mode: "rb") =~ /^#==>(.*)/
require "zlib"
require "base64"
encoded_compressed = $1
unescaped_compressed = Base64.decode64(encoded_compressed)
inflated = Zlib::Inflate.inflate(unescaped_compressed)
File.open(script, "wb") do |fh|
fh.write(inflated)
end
else
raise "Could not decompress."
end
end
load script
if __FILE__ == $0
Rscons::Cli.new.run(ARGV)
end
#==>eJztff13GzeS4O/5K9ptJyZlirIzN7PvMVYkW5IT7cmWT5KznqUZDkU2pR6T3dxuUrJW5v7thyp8VQHoJiXbuey+87yJ2PgoAIVCoVAoVD18sLUoi63zNNtKsquoWJzffFck/7FIiySKs2S+dTmfz2KbNEovknIefzfNR4tJEp2Uwzwrv4si9f0iK1PxFUXDyaAso+fPozKZjDElik4OTg/Oou0o/pB0n05jlTpKxtF1kc6TRpq3oo1pUpaDi6SpckV+3h/mk7wQFWVr7cFsNkmHg3maZ22ROxBtyiKmTjo21dpZOtkxGQycqrsjGrbNJdnI/M4Xc+huHIJLQA4XRZFkc9tNGCdtMikF7kaV+WrI7WQwvBTwo8/TzyQXW52207I/2Gmczos0u2iy7CiapFlSCsDTdikwM2/EH7K4FW0+C5bDZvrX6fyyn2aj5BO2CDmtKP3sVMC2IS96wPDA8vnwRUE23kAdidgn6xR0UbuqBp09rzkYiJcbqiEGlUbPFbrK9D+TaDN6tubg3cn1elFdYBUdrTVImPs1BummJJPSxc1wUCbR1Em8vkyyqCOm4Cea6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v50475OjZ2VRTQrtFcUSPgtpmjJ3HAuSqYIQQJrsFwyc+LT07eINNZfB2B9X3Xlr6POqG6HtpHqVcuwjEkLine truncated
-41
View File
@@ -1,41 +0,0 @@
scene
{
options
{
multisample 3
width 800
height 600
ambient_occlusion 5
}
camera
{
position <2, -3, 2>
look_at <0, 0, 1>
up <0, 0, 1>
}
light
{
position <200, -10, 50>
}
define material white
{
color <1, 1, 1>
}
sphere
{
radius 1
material white
translate <0, 0, 1>
}
plane
{
position <0, 0, 1>, 0
material white
}
}
-228
View File
@@ -1,228 +0,0 @@
scene
{
options
{
multisample 3
}
camera
{
position <3, -2.6, 2>
look_at <1.5, -1, 0>
up <0, 0, 1>
}
light
{
position <-2, -5, 6>
}
plane
{
position <1, -1, 1.5>, 3
material
{
color <1, 1, 0>
}
}
define material green
{
color <0, 1, 0>
shininess 3
}
subtract
{
intersect
{
box
{
size <1, 1, 1>
material
{
color <1, 0.4, 0.4>
}
}
sphere
{
radius 0.67
material
{
color <0, 0, 1>
shininess 3
}
}
}
union
{
cyl
{
size <0.35, 0.35, 1.2>
translate <0, 0, -0.6>
material green
}
union
{
cyl
{
size <0.35, 0.35, 1.2>
rotate 90, <1, 0, 0>
translate <0, 0, -0.6>
material green
}
cyl
{
size <0.35, 0.35, 1.2>
rotate 90, <0, 1, 0>
translate <0, 0, -0.6>
material green
}
}
}
}
scale <0.5, 0.5, 0.5>
{
translate <0, -3, -2>
{
intersect
{
box
{
size <1, 1, 1>
material
{
color <1, 0.4, 0.4>
}
}
sphere
{
radius 0.67
material
{
color <0, 0, 1>
shininess 3
}
}
}
translate <0, -1.5, -1>
{
box
{
size <1, 1, 1>
material
{
color <1, 0.4, 0.4>
}
}
}
translate <1.5, 0, -1>
{
sphere
{
radius 0.67
material
{
color <0, 0, 1>
shininess 3
}
}
}
}
translate <3, 0, -2>
{
union
{
cyl
{
size <0.35, 0.35, 1.2>
translate <0, 0, -0.6>
material green
}
union
{
cyl
{
size <0.35, 0.35, 1.2>
rotate 90, <1, 0, 0>
translate <0, 0, -0.6>
material green
}
cyl
{
size <0.35, 0.35, 1.2>
rotate 90, <0, 1, 0>
translate <0, 0, -0.6>
material green
}
}
}
translate <0, -1.5, -1>
{
cyl
{
size <0.35, 0.35, 1.2>
translate <0, 0, -0.6>
material green
}
}
translate <1.5, 0, -1>
{
union
{
cyl
{
size <0.35, 0.35, 1.2>
rotate 90, <1, 0, 0>
translate <0, 0, -0.6>
material green
}
cyl
{
size <0.35, 0.35, 1.2>
rotate 90, <0, 1, 0>
translate <0, 0, -0.6>
material green
}
}
translate <0, -1.5, -1>
{
cyl
{
size <0.35, 0.35, 1.2>
rotate 90, <1, 0, 0>
translate <0, 0, -0.6>
material green
}
}
translate <1.5, 0, -1>
{
cyl
{
size <0.35, 0.35, 1.2>
rotate 90, <0, 1, 0>
translate <0, 0, -0.6>
material green
}
}
}
}
}
}
-84
View File
@@ -1,84 +0,0 @@
scene
{
options
{
width 800
height 600
multisample 3
}
camera
{
position <1.0, -2, 1.2>
look_at <0, 0, 0.4>
up <0, 0, 1>
}
light
{
position <10, 0, 10>
}
define material cyan
{
color <0, 1, 1>
}
plane
{
position <0, 0, 1>, 0
material
{
color <1, 1, 0>
reflectance 0.6
}
}
translate <0, 0, 0.7>
{
box
{
size <0.4, 0.4, 0.4>
material
{
color <1.0, 0.6, 0>
}
}
cyl {
size <0.2, 0, 0.3>
translate <0, 0, 0.3>
material cyan
}
cyl {
size <0.2, 0, 0.3>
rotate 90, <1, 0, 0>
translate <0, 0, 0.3>
material cyan
}
cyl {
size <0.2, 0, 0.3>
rotate -90, <1, 0, 0>
translate <0, 0, 0.3>
material cyan
}
cyl {
size <0.2, 0, 0.3>
rotate 180, <1, 0, 0>
translate <0, 0, 0.3>
material cyan
}
cyl {
size <0.2, 0, 0.3>
rotate 90, <0, 1, 0>
translate <0, 0, 0.3>
material cyan
}
cyl {
size <0.2, 0, 0.3>
rotate -90, <0, 1, 0>
translate <0, 0, 0.3>
material cyan
}
}
}
-152
View File
@@ -1,152 +0,0 @@
scene
{
options
{
multisample 3
exposure 1.2
}
camera
{
position <1.2, -2, 1>
look_at <0, 0, 0>
}
light { position <10, -12, 8> }
plane
{
position <0, 0, 1>, 0.501
material
{
color <0.4, 1, 0.4>
reflectance 0.4
}
}
plane
{
position <1, 0, 0>, 1
material
{
color <1, 0.4, 0.4>
reflectance 0.4
}
}
plane
{
position <0, -1, 0>, 1
material
{
color <0.4, 0.4, 1>
reflectance 0.4
}
}
subtract
{
union
{
box { size <1, 0.8, 0.8> }
box { size <0.8, 1, 0.8> }
box { size <0.8, 0.8, 1> }
cyl { size <0.1, 0.1, 0.8> translate <0.4, 0.4, -0.4> }
cyl { size <0.1, 0.1, 0.8> translate <0.4, -0.4, -0.4> }
cyl { size <0.1, 0.1, 0.8> translate <-0.4, 0.4, -0.4> }
cyl { size <0.1, 0.1, 0.8> translate <-0.4, -0.4, -0.4> }
cyl {
size <.1, .1, .8>
translate <.4, -.4, .4>
rotate -90, <1, 0, 0>
}
cyl {
size <.1, .1, .8>
translate <.4, -.4, -.4>
rotate -90, <1, 0, 0>
}
cyl {
size <.1, .1, .8>
translate <-.4, -.4, .4>
rotate -90, <1, 0, 0>
}
cyl {
size <.1, .1, .8>
translate <-.4, -.4, -.4>
rotate -90, <1, 0, 0>
}
cyl {
size <.1, .1, .8>
translate <.4, -.4, .4>
rotate -90, <0, 1, 0>
}
cyl {
size <.1, .1, .8>
translate <.4, -.4, -.4>
rotate -90, <0, 1, 0>
}
cyl {
size <.1, .1, .8>
translate <.4, .4, .4>
rotate -90, <0, 1, 0>
}
cyl {
size <.1, .1, .8>
translate <.4, .4, -.4>
rotate -90, <0, 1, 0>
}
sphere { radius .1 translate <.4, .4, .4> }
sphere { radius .1 translate <.4, .4, -.4> }
sphere { radius .1 translate <.4, -.4, .4> }
sphere { radius .1 translate <.4, -.4, -.4> }
sphere { radius .1 translate <-.4, .4, .4> }
sphere { radius .1 translate <-.4, .4, -.4> }
sphere { radius .1 translate <-.4, -.4, .4> }
sphere { radius .1 translate <-.4, -.4, -.4> }
material
{
color <1, 0.4, 1>
transparency 0.4
}
}
union
{
sphere { radius .1 translate <0, -.5, 0> }
sphere { radius .1 translate <-.5, .25, -.25> }
sphere { radius .1 translate <-.5, -.25, .25> }
sphere { radius .1 translate <0, 0, -.5> }
sphere { radius .1 translate <.25, -.25, -.5> }
sphere { radius .1 translate <-.25, .25, -.5> }
sphere { radius .1 translate <-.25, -.25, .5> }
sphere { radius .1 translate <-.25, .25, .5> }
sphere { radius .1 translate <.25, -.25, .5> }
sphere { radius .1 translate <.25, .25, .5> }
sphere { radius .1 translate <.5, 0, 0> }
sphere { radius .1 translate <.5, .25, .25> }
sphere { radius .1 translate <.5, .25, -.25> }
sphere { radius .1 translate <.5, -.25, .25> }
sphere { radius .1 translate <.5, -.25, -.25> }
sphere { radius .1 translate <.25, .5, 0> }
sphere { radius .1 translate <.25, .5, -.25> }
sphere { radius .1 translate <.25, .5, .25> }
sphere { radius .1 translate <-.25, .5, 0> }
sphere { radius .1 translate <-.25, .5, -.25> }
sphere { radius .1 translate <-.25, .5, .25> }
material
{
color <1, 1, 1>
}
}
}
}
-134
View File
@@ -1,134 +0,0 @@
scene
{
options
{
ambient <0.2, 0.2, 0.2>
}
define material dw_blue {
color <0.000, 0.520, 0.546>
specular <0.5, 0.5, 0.5>
}
define material dw_brown {
color <0.634, 0.628, 0.126>
specular <0.5, 0.5, 0.5>
}
define material grey_ground {
color <0.3, 0.3, 0.3>
specular <0, 0, 0>
}
define shape dw_logo union {
subtract {
intersect {
cyl {
size <3.055, 3.055, 0.5>
translate <-4.454, 0.074, -0.25>
}
box {
size <6.01, 5.94, 1>
translate <-1.782, 0, 0>
}
}
cyl {
size <0.738, 0.738, 2>
translate <-3.645, 0.041, -1>
}
box {
size <1.96, 0.456, 2>
translate <-2.212, 0.048, 0>
}
material dw_blue
}
cyl {
size <0.307, 0.307, 0.5>
translate <-3.645, 0.041, -0.25>
material dw_brown
}
subtract {
extrude {
offset 0.5
polygon {
<4.787, -2.971>
<4.787, 1.565>
<4.196, 1.565>
<2.756, -2.375>
<1.367, 1.052>
<0.007, -2.40192>
<-0.891, -0.174>
<-3, -0.174>
<-3, -2.971>
}
translate <0, 0, -0.25>
}
cyl {
size <3.488, 3.488, 2>
translate <-4.454, 0.074, -1>
}
material dw_blue
}
subtract {
extrude {
offset 0.5
polygon {
<4.787, 2.025>
<4.787, 2.971>
<-3, 2.971>
<-3, 0.283>
<-0.588, 0.283>
<0.000, -1.179>
<1.368, 2.273>
<2.728, -1.083>
<3.877, 2.025>
}
translate <0, 0, -0.25>
}
cyl {
size <3.488, 3.488, 2>
translate <-4.454, 0.074, -1>
}
material dw_brown
}
scale 0.104
}
camera
{
position <0, 0, 10>
look_at <0, 0, 0>
up <0, 1, 0>
}
light
{
position <100, -100, 100>
}
plane
{
position <0, 0, 1>, 0
material grey_ground
}
for (local $i = 0; $i < 4; $i = $i + 1)
{
local $n_logos = 2 ^ ($i + 2)
for (local $j = 0; $j < $n_logos; $j = $j + 1)
{
shape dw_logo
{
rotate $j * 360 / $n_logos, <0, 0, 1>
translate <1.5 * ($i + 1), 0, 0.4 - 0.1 * $i>
if ($i > 0 && ($j + $i) % 2 == 1)
{
rotate 90, <0, 0, 1>
}
rotate -90, <0, 0, 1>
}
}
}
shape dw_logo { translate <0, 0, 0.5> }
}
-123
View File
@@ -1,123 +0,0 @@
scene {
define material dw_blue {
color <0.000, 0.520, 0.546>
specular <0.5, 0.5, 0.5>
}
define material dw_brown {
color <0.634, 0.628, 0.126>
specular <0.5, 0.5, 0.5>
}
define material grey_ground {
color <0.3, 0.3, 0.3>
shininess 30
}
define shape dw_logo union {
subtract {
intersect {
cyl {
size <3.055, 3.055, 0.5>
translate <-4.454, 0.074, -0.25>
}
box {
size <6.01, 5.94, 1>
translate <-1.782, 0, 0>
}
}
cyl {
size <0.738, 0.738, 2>
translate <-3.645, 0.041, -1>
}
box {
size <1.96, 0.456, 2>
translate <-2.212, 0.048, 0>
}
material dw_blue
}
cyl {
size <0.307, 0.307, 0.5>
translate <-3.645, 0.041, -0.25>
material dw_brown
}
subtract {
extrude {
offset 0.5
polygon {
<4.787, -2.971>
<4.787, 1.565>
<4.196, 1.565>
<2.756, -2.375>
<1.367, 1.052>
<0.007, -2.40192>
<-0.891, -0.174>
<-3, -0.174>
<-3, -2.971>
}
translate <0, 0, -0.25>
}
cyl {
size <3.488, 3.488, 2>
translate <-4.454, 0.074, -1>
}
material dw_blue
}
subtract {
extrude {
offset 0.5
polygon {
<4.787, 2.025>
<4.787, 2.971>
<-3, 2.971>
<-3, 0.283>
<-0.588, 0.283>
<0.000, -1.179>
<1.368, 2.273>
<2.728, -1.083>
<3.877, 2.025>
}
translate <0, 0, -0.25>
}
cyl {
size <3.488, 3.488, 2>
translate <-4.454, 0.074, -1>
}
material dw_brown
}
scale 0.104
}
shape dw_logo {
translate <0, 0.387, 0.309>
rotate 90, <1, 0, 0>
}
subtract {
plane {
position <0, 0, 1>, 0
}
shape dw_logo {
translate <0, 0, -0.025>
}
material grey_ground
}
camera {
position <-0.2, -0.8, 0.4>
look_at <-0.1, 0, 0.2>
up <0, 0, 1>
}
light {
position <10, -12, 5>
radius 0.2
jitter 3
}
options {
ambient_occlusion 5
multisample 3
}
}
-53
View File
@@ -1,53 +0,0 @@
scene
{
options
{
ambient_occlusion 2
multisample 2
exposure 1.2
}
camera
{
position <0, -10, 10>
look_at <0, 0, 2>
}
light { position <10, -12, 8> }
plane
{
position <0, 0, 1>, 0
material
{
color <0, 0.5, 0.1>
}
}
subtract
{
extrude { ngon 5, 6 offset 2 }
extrude { ngon 5, 5 offset 3 translate <0, 0, -0.5> }
material { color <1, 0.7, 0> }
}
union
{
extrude
{
ngon 6, 2
offset 3 { scale 0.5 position <4, 0> }
offset 3
offset 1 { scale 0 }
}
extrude
{
ngon 6, 2
offset 3 { scale 0.5 position <-4, 0> }
offset 3
offset 1 { scale 0 }
}
material { color <0, 0.9, 0.9> }
}
}
-55
View File
@@ -1,55 +0,0 @@
scene
{
camera
{
position <0, -40, 50>
look_at <0, 100, 0>
}
light
{
position <100, -100, 50>
}
define material mat
{
color <0, 0.8, 1>
}
define material glass
{
transparency 1
refraction 1.5
}
plane
{
position <0, 0, 1>, 0
material
{
color <0, 0.7, 0>
}
}
for (local $x = -200; $x <= 200; $x = $x + 40)
{
for (local $y = 0; $y <= 4000; $y = $y + 40)
{
sphere
{
radius 10
translate <$x, $y, 10>
if ($x == 0 && $y == 0)
{
material glass
translate <0, 0, 20>
}
else
{
material mat
}
}
}
}
}
-57
View File
@@ -1,57 +0,0 @@
scene
{
camera
{
position <0, -120, 80>
look_at <0, -40, 5>
}
light
{
position <100, -100, 100>
}
define material mat { color <0, 0.8, 1> }
define material mat2 { color <1, 0.7, 0> }
define material mat3 { transparency 0.5 reflectance 0.7 }
plane
{
position <0, 0, 1>, 0
material
{
color <0, 0.7, 0>
}
}
local $m = 0
for (local $x = -100; $x <= 100; $x = $x + 40)
{
for (local $y = -100; $y <= 100; $y = $y + 40)
{
sphere
{
radius 10
translate <$x, $y, 10>
if ($m % 3 == 0)
{
material mat
}
elsif ($m % 3 == 1)
{
material mat2
}
else
{
material
{
color <1, 0, 0>
transparency abs($x / 120)
}
}
}
$m = $m + 1
}
}
}
-54
View File
@@ -1,54 +0,0 @@
scene
{
options
{
multisample 4
width 1024
height 768
max_depth 15
}
camera
{
position <0.00001, -1.9, -0.000001>
look_at <0, 0, 0>
up <0, 0, 1>
}
define material mirror
{
color <0, 0, 0>
specular <0, 0, 0>
reflectance 1.0
}
plane { position <1, 0, 0>, 2 material mirror }
plane { position <-1, 0, 0>, 2 material mirror }
plane { position <0, 1, 0>, 2 material mirror }
plane { position <0, -1, 0>, 2 material mirror }
plane { position <0, 0, 1>, 2 material mirror }
plane { position <0, 0, -1>, 2 material mirror }
sphere
{
radius 0.5
material
{
reflectance 0.2
ambient <0.5, 0.5, 0.5>
diffuse <0.5, 0.5, 0.5>
shininess 80
}
}
light
{
position <1, -1, 1>
}
light
{
position <-1, 1, -1>
}
}
-151
View File
@@ -1,151 +0,0 @@
scene
{
options
{
ambient_occlusion 3
multisample 3
exposure 1.2
}
camera
{
position <5, -13, 9>
look_at <0, 0, 2>
}
light { position <10, -12, 8> radius 0.2 jitter 4 }
plane
{
position <0, 0, 1>, 0
material
{
color <0, 0.5, 0.1>
}
}
# define a reusable Die type
define shape Die subtract
{
union
{
box { size <1, 0.8, 0.8> }
box { size <0.8, 1, 0.8> }
box { size <0.8, 0.8, 1> }
cyl { size <0.1, 0.1, 0.8> translate <0.4, 0.4, -0.4> }
cyl { size <0.1, 0.1, 0.8> translate <0.4, -0.4, -0.4> }
cyl { size <0.1, 0.1, 0.8> translate <-0.4, 0.4, -0.4> }
cyl { size <0.1, 0.1, 0.8> translate <-0.4, -0.4, -0.4> }
cyl {
size <.1, .1, .8>
translate <.4, -.4, .4>
rotate -90, <1, 0, 0>
}
cyl {
size <.1, .1, .8>
translate <.4, -.4, -.4>
rotate -90, <1, 0, 0>
}
cyl {
size <.1, .1, .8>
translate <-.4, -.4, .4>
rotate -90, <1, 0, 0>
}
cyl {
size <.1, .1, .8>
translate <-.4, -.4, -.4>
rotate -90, <1, 0, 0>
}
cyl {
size <.1, .1, .8>
translate <.4, -.4, .4>
rotate -90, <0, 1, 0>
}
cyl {
size <.1, .1, .8>
translate <.4, -.4, -.4>
rotate -90, <0, 1, 0>
}
cyl {
size <.1, .1, .8>
translate <.4, .4, .4>
rotate -90, <0, 1, 0>
}
cyl {
size <.1, .1, .8>
translate <.4, .4, -.4>
rotate -90, <0, 1, 0>
}
define shape Corner sphere { radius 0.1 }
translate <.4, .4, .4> { shape Corner }
translate <.4, .4, -.4> { shape Corner }
translate <.4, -.4, .4> { shape Corner }
translate <.4, -.4, -.4> { shape Corner }
translate <-.4, .4, .4> { shape Corner }
translate <-.4, .4, -.4> { shape Corner }
translate <-.4, -.4, .4> { shape Corner }
translate <-.4, -.4, -.4> { shape Corner }
material
{
color <1, 0.4, 1>
transparency 0.4
}
}
union
{
define shape Pip sphere { radius 0.1 }
translate <0, -.5, 0> { shape Pip }
translate <-.5, .25, -.25> { shape Pip }
translate <-.5, -.25, .25> { shape Pip }
translate <0, 0, -.5> { shape Pip }
translate <.25, -.25, -.5> { shape Pip }
translate <-.25, .25, -.5> { shape Pip }
translate <-.25, -.25, .5> { shape Pip }
translate <-.25, .25, .5> { shape Pip }
translate <.25, -.25, .5> { shape Pip }
translate <.25, .25, .5> { shape Pip }
translate <.5, 0, 0> { shape Pip }
translate <.5, .25, .25> { shape Pip }
translate <.5, .25, -.25> { shape Pip }
translate <.5, -.25, .25> { shape Pip }
translate <.5, -.25, -.25> { shape Pip }
translate <.25, .5, 0> { shape Pip }
translate <.25, .5, -.25> { shape Pip }
translate <.25, .5, .25> { shape Pip }
translate <-.25, .5, 0> { shape Pip }
translate <-.25, .5, -.25> { shape Pip }
translate <-.25, .5, .25> { shape Pip }
material
{
color <1, 1, 1>
}
}
}
# Define an individual stack of dies
define shape DieStack union
{
translate <0, 0, 1.5> { scale 3 { shape Die } }
translate <0, 0, 4> { rotate 45, <0, 0, 1> { scale 2 { shape Die } } }
translate <0, 0, 5.5> { rotate 90, <0, 1, 0> { shape Die } }
}
# Instantiate various DieStack objects
translate <-5, 0, 0> { shape DieStack }
translate <5, 0, 0> { rotate 90, <0, 0, 1> { shape DieStack } }
translate <0, 5, 0> { rotate 180, <0, 0, 1> { shape DieStack } }
translate <0, -5, 0> { rotate 270, <0, 0, 1> { shape DieStack } }
}
-27
View File
@@ -1,27 +0,0 @@
scene {
options {
width 400
height 300
}
camera {
position <5, -5, 4>
look_at <0, 0, 1>
}
light {
position <10, -10, 50>
}
plane {
position <0, 0, 1>, 0
material {
color <0, 1, 0.2>
reflectance 0.4
}
}
sphere {
radius 1
translate <0, 0, 1>
material {
color <1, 1, 0>
}
}
}
-55
View File
@@ -1,55 +0,0 @@
scene
{
options
{
multisample 3
ambient <0.2, 0.2, 0.2>
}
camera
{
position <1, -2, 1>
look_at <0, 0, 0>
}
light
{
position <-5, -15, 20>
jitter 5
}
plane
{
position <0, 0, 1>, 1
material
{
color <0, 1, 1>
}
}
subtract
{
box
{
size <1, 1, 1>
material { color <0.2, 0.2, 1> }
}
subtract
{
sphere
{
radius 0.4
material { color <1, 0, 0> }
translate <0, -0.5, 0>
}
box
{
size <1, 1, 0.2>
material { color <0, 1, 0> }
translate <0, -0.5, 0>
}
}
}
}
-46
View File
@@ -1,46 +0,0 @@
scene
{
options
{
width 800
height 600
multisample 3
}
camera
{
position <2, -2.5, 3>
look_at <-0.5, 0, 0>
up <0, 0, 1>
}
light { position <5, 0, 5> }
plane
{
position <0, 0, 1>, 0
material { color <0.8, 0.8, 0.8> }
}
box
{
size <1, 1, 1>
translate <0, -1.5, 0.6>
material { color <0, 0, 1> transparency 0.8 }
}
box
{
size <1, 1, 1>
translate <0, 0, 0.6>
material { color <0, 0, 1> transparency 0.4 }
}
box
{
size <1, 1, 1>
translate <0, 1.5, 0.6>
material { color <0, 0, 1> transparency 0.1 }
}
}
+57
View File
@@ -0,0 +1,57 @@
macro_rules! options {
($($name:ident $sflag:literal $lflag:literal $hasarg:literal),* $(,)?) => {
enum Options {
$($name,)*
}
const SHORT_FLAGS: &[&str] = &[
$($sflag,)*
];
const LONG_FLAGS: &[&str] = &[
$($lflag,)*
];
const HAS_ARG: &[bool] = &[
$($hasarg,)*
];
};
}
options! {
Width "w" "width" true,
Height "h" "height" true,
}
#[derive(Default)]
pub struct Cli {
width: Option<usize>,
height: Option<usize>,
input_file: String,
}
impl Cli {
pub fn new() -> Self {
Cli::default()
}
pub fn run(&mut self) -> Option<()> {
let mut args = std::env::args();
/* Skip program name. */
args.next();
loop {
if let Some(arg) = args.next() {
if arg.starts_with("--") {
let flag = &arg[2..];
} else if arg.starts_with("-") {
let flag = &arg[1..2];
} else {
self.input_file = arg;
}
} else {
break;
}
}
Some(())
}
}
-54
View File
@@ -1,54 +0,0 @@
module fart.bfile;
import std.stdio;
/**
* Struct to handle easily writing data to a binary file.
*/
public struct BFile
{
/**
* Underlying file handle.
*/
private File m_file;
/**
* Create a binary file.
*/
this(string filename)
{
m_file = File(filename, "wb");
}
/**
* Write arbitrary byte data to the file.
*/
public void write(const(void) * data, size_t length)
{
write((cast(const(ubyte) *)data)[0..length]);
}
/**
* Write an array to the file.
*/
public void write(T)(const(T)[] data)
{
m_file.rawWrite(data);
}
/**
* Write an arbitrary object to the file.
*/
public void writeObject(T)(ref const(T) obj)
{
write(&obj, obj.sizeof);
}
/**
* Close the file.
*/
public void close()
{
m_file.close();
}
}
-45
View File
@@ -1,45 +0,0 @@
module fart.color;
/**
* Structure to represent a RGBA color value.
*/
struct Color
{
/** Red color component. */
double r;
/** Green color component. */
double g;
/** Blue color component. */
double b;
/** Alpha color component. */
double a;
/**
* Convert color to a 32-bit integer RGBA value.
*
* Each color component uses one byte.
*/
public ubyte[] rgba32() const
{
return [toubyte(r), toubyte(g), toubyte(b), toubyte(a)];
}
/**
* Scale a floating point color component value to an unsigned 8-bit byte
* value.
*
* @param v
* Floating point color component value.
*
* @return Unsigned 8-bit byte value for the color component.
*/
private static ubyte toubyte(double v)
{
return cast(ubyte)(0xFF * v);
}
public static immutable Color TRANSPARENT = Color(0, 0, 0, 0);
}
-18
View File
@@ -1,18 +0,0 @@
module fart.crc32;
import std.digest.crc;
/**
* Calculate the CRC32 across the given chunk(s) of data.
*/
public uint crc32(Args...)(Args data)
{
CRC32 crc32;
crc32.start();
static foreach (arg; data)
{
crc32.put(cast(const(ubyte)[])arg);
}
auto crc = crc32.finish();
return crc[0] | (crc[1] << 8) | (crc[2] << 16) | (crc[3] << 24);
}
-35
View File
@@ -1,35 +0,0 @@
/**
* @file
*
* Host to network byte-swapping functions.
*/
module fart.hton;
version (BigEndian)
{
public uint htonl(uint v)
{
return v;
}
public uint ntohl(uint v)
{
return v;
}
}
version (LittleEndian)
{
import core.bitop;
public uint htonl(uint v)
{
return bswap(v);
}
public uint ntohl(uint v)
{
return bswap(v);
}
}
-27
View File
@@ -1,27 +0,0 @@
module fart.main;
import fart.png;
import fart.color;
/**
* Main program entry point.
*
* @param args
* Program arguments.
*/
int main(string[] args)
{
size_t width = 800;
size_t height = 600;
string output_filename = "out.png";
Color[] pixels = [];
for (size_t y = 0; y < height; y++)
{
for (size_t x = 0; x < width; x++)
{
pixels ~= Color.TRANSPARENT;
}
}
write_png(output_filename, width, height, pixels);
return 0;
}
-158
View File
@@ -1,158 +0,0 @@
module fart.png;
import std.zlib;
import std.digest;
import fart.bfile;
import fart.crc32;
import fart.hton;
import fart.color;
/**
* PNG file header.
*/
private immutable ubyte[] HEADER = [0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A];
/**
* PNG IHDR chunk.
*/
struct IHDR
{
uint width;
uint height;
ubyte bit_depth;
ubyte color_type;
ubyte compression;
ubyte filter;
ubyte interlace;
ubyte[0] end;
this(size_t width, size_t height)
{
this.width = htonl(cast(uint)width);
this.height = htonl(cast(uint)height);
this.bit_depth = 8;
this.color_type = 6;
this.compression = 0;
this.filter = 0;
this.interlace = 0;
}
public const(void) * data()
{
return &this;
}
public size_t data_length()
{
return end.offsetof;
}
}
/**
* PNG IDAT chunk.
*/
struct IDAT
{
private const(ubyte)[] m_data;
this(ubyte[] data)
{
m_data = compress(data);
}
public const(void) * data()
{
return m_data.ptr;
}
public size_t data_length()
{
return m_data.length;
}
}
/**
* PNG IEND chunk.
*/
struct IEND
{
public const(void) * data()
{
return &this;
}
public size_t data_length()
{
return 0;
}
}
/**
* Write a PNG chunk to the output file.
*
* @param file
* Output file
* @param chunk_type
* Chunk type.
* @param chunk
* Chunk to write.
*/
private void write_chunk(Chunk)(BFile file, string chunk_type, Chunk chunk)
{
size_t chunk_data_length = chunk.data_length();
uint chunk_length_be32 = htonl(cast(uint)chunk_data_length);
file.writeObject(chunk_length_be32);
file.write(chunk_type);
const(ubyte)[] chunk_data = (cast(const(ubyte) *)chunk.data())[0..chunk_data_length];
file.write(chunk_data);
uint crc_be32 = htonl(crc32(chunk_type, chunk_data));
file.writeObject(crc_be32);
}
/**
* Write a PNG image from the given metadata and pixel data.
*
* @param filename
* Name of file to write.
* @param width
* Width of image.
* @param height
* Height of image.
* @param data
* Pixel color data.
*/
public void write_png(string filename, size_t width, size_t height, const(Color)[] data)
{
if (data.length != width * height)
return;
/* Convert Color values to 32-bit RGBA values. */
ubyte[] pixel_data;
size_t data_index;
for (size_t y = 0; y < height; y++)
{
/* Filter method 0 (None) */
pixel_data ~= 0;
for (size_t x = 0; x < width; x++)
{
pixel_data ~= data[data_index++].rgba32();
}
}
/* Open output file. */
BFile file = BFile(filename);
/* Write PNG header. */
file.write(HEADER);
/* Write IHDR chunk. */
IHDR ihdr = IHDR(width, height);
write_chunk(file, "IHDR", ihdr);
/* Write IDAT chunk. */
IDAT idat = IDAT(pixel_data);
write_chunk(file, "IDAT", idat);
/* Write IEND chunk. */
IEND iend;
write_chunk(file, "IEND", iend);
/* Close output file. */
file.close();
}
-190
View File
@@ -1,190 +0,0 @@
module fart.vector;
import std.math;
/**
* Structure to represent a 3-dimensional vector.
*/
struct Vector
{
/** Vector X coordinate. */
double x;
/** Vector Y coordinate. */
double y;
/** Vector Z coordinate. */
double z;
/**
* Compute the cross product of two vectors.
*/
public Vector cross()(auto ref const Vector other) const
{
return Vector(y * other.z - z * other.y,
z * other.x - x * other.z,
x * other.y - y * other.x);
}
/**
* Compute the dot product of two vectors.
*/
public double dot()(auto ref const Vector other) const
{
return x * other.x + y * other.y + z * other.z;
}
/**
* Get the magnitude of the vector.
*/
public double mag() const
{
return sqrt(mag2());
}
/**
* Get the squared magnitude of the vector.
*/
public double mag2() const
{
return x * x + y * y + z * z;
}
/**
* Normalize the vector to have unit length.
*/
public ref Vector normalize()
{
double mag = mag();
x /= mag;
y /= mag;
z /= mag;
return this;
}
/**
* Get a normalized vector in the same direction as this.
*/
public Vector normalized() const
{
double mag = mag();
return Vector(x / mag, y / mag, z / mag);
}
/**
* Project the vector onto a target vector.
*/
public Vector proj()(auto ref const Vector other) const
{
Vector on = other.normalized();
return on * dot(on);
}
/**
* Add two vectors.
*/
public Vector opBinary(string op : "+")(auto ref const Vector other) const
{
return Vector(x + other.x, y + other.y, z + other.z);
}
/**
* Add two vectors and assign to self.
*/
public Vector opOpAssign(string op : "+")(auto ref const Vector other)
{
x += other.x;
y += other.y;
z += other.z;
return this;
}
/**
* Negate a vector.
*/
public Vector opUnary(string op : "-")() const
{
return Vector(-x, -y, -z);
}
/**
* Subtract two vectors.
*/
public Vector opBinary(string op : "-")(auto ref const Vector other) const
{
return Vector(x - other.x, y - other.y, z - other.z);
}
/**
* Subtract two vectors and assign to self.
*/
public Vector opOpAssign(string op : "-")(auto ref const Vector other)
{
x -= other.x;
y -= other.y;
z -= other.z;
return this;
}
/**
* Scale a vector.
*/
public Vector opBinary(string op : "*")(double m) const
{
return Vector(x * m, y * m, z * m);
}
/**
* Scale a vector.
*/
public Vector opBinaryRight(string op : "*")(double m) const
{
return Vector(x * m, y * m, z * m);
}
/**
* Compute the cross product of two vectors.
*/
public Vector opBinary(string op : "*")(auto ref const Vector other) const
{
return cross(other);
}
public static immutable Vector X = Vector(1.0, 0.0, 0.0);
public static immutable Vector Y = Vector(0.0, 1.0, 0.0);
public static immutable Vector Z = Vector(0.0, 0.0, 1.0);
}
unittest
{
Vector v = Vector(1, 2, 3);
const Vector w = Vector(0, 4, 5);
Vector v_times_2 = v * 2;
assert(v_times_2.x == 2);
assert(v_times_2.y == 4);
assert(v_times_2.z == 6);
Vector v_plus_w = v + w;
assert(v_plus_w == Vector(1, 6, 8));
Vector v_minus_w = v - w;
assert(v_minus_w == Vector(1, -2, -2));
assert(v_minus_w.mag2() == 9.0);
assert(v_minus_w.mag() == 3.0);
v += v_minus_w;
assert(v == 2 * Vector.X + 0 * Vector.Y + Vector.Z);
assert(Vector.X * Vector.Y == Vector.Z);
assert(Vector.Y * Vector.Z == Vector.X);
assert(Vector.Z * Vector.X == Vector.Y);
assert(Vector.Y * Vector.X == -Vector.Z);
assert(Vector.Z * Vector.Y == -Vector.X);
assert(Vector.X * Vector.Z == -Vector.Y);
assert(w.proj(Vector.X) == Vector(0, 0, 0));
assert(w.proj(Vector.Y) == Vector(0, 4, 0));
assert(w.proj(Vector.Z) == Vector(0, 0, 5));
}
+16
View File
@@ -0,0 +1,16 @@
mod cli;
use crate::cli::Cli;
use std::process::ExitCode;
fn main() -> ExitCode {
match run() {
Some(_) => ExitCode::SUCCESS,
None => ExitCode::FAILURE,
}
}
fn run() -> Option<()> {
let mut cli = Cli::new();
cli.run()
}
-22
View File
@@ -1,22 +0,0 @@
<<
import std.conv;
>>
token background;
token comma /,/;
token number /\d+(\.\d+)?/;
token lt /</;
token gt />/;
token semicolon /;/;
Start -> Statements;
Statements -> ;
Statements -> Statement Statements;
Statement -> BackgroundStatement;
BackgroundStatement -> background Vec3 semicolon;
Vec3 -> lt number comma number comma number gt;
-27
View File
@@ -1,27 +0,0 @@
" Vim syntax file
" Setup
if version >= 600
" Quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
endif
syn case match
syn keyword fartKeywords ambient ambient_occlusion color define diffuse exposure height jitter look_at material max_depth multisample ngon offset polygon position radius reflectance refraction rotate scale shininess size specular texture translate transparency union up vfov width
syn keyword fartObjects box camera cyl extrude intersect light options plane scene shape sphere subtract union
syn keyword fartControl for while if else elsif local
syn match fartNumber "\(^\|\W\)\@<=[+-]\=\(\d\+\)\=\.\=\d\+\([eE][+-]\=\d\+\)\="
syn match fartComment "#.*"
syn match fartIdentifier "\$[a-zA-Z_][a-zA-Z_0-9]*"
hi def link fartKeywords Operator
hi def link fartObjects Type
hi def link fartNumber Number
hi def link fartComment Comment
hi def link fartControl Special
hi def link fartIdentifier Identifier
let b:current_syntax = "fart"
-3
View File
@@ -1,3 +0,0 @@
if has("autocmd")
autocmd BufRead *.fart set syntax=fart
endif " has("autocmd")