-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
237 lines (236 loc) · 5.77 KB
/
Copy pathindex.html
File metadata and controls
237 lines (236 loc) · 5.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pixelforge Demo</title>
<style>
body {
margin: 0;
background: #1a1a1a;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
min-height: 100vh;
padding-top: 40px;
font-family: monospace;
color: #ccc;
}
h1.site-title {
font-size: 26px;
color: #e8e8e8;
margin: 0 0 32px;
font-weight: bold;
letter-spacing: 0.5px;
max-width: 720px;
text-align: center;
line-height: 1.4;
}
.controls {
margin-bottom: 12px;
display: flex;
gap: 20px;
}
.controls label {
cursor: pointer;
font-size: 13px;
}
.controls input[type="radio"] {
cursor: pointer;
margin-right: 4px;
}
.controls button {
cursor: pointer;
font-family: monospace;
font-size: 13px;
padding: 2px 12px;
background: #444;
color: #ccc;
border: 1px solid #666;
}
.controls button:hover {
background: #555;
}
.frame {
position: relative;
padding: 40px;
background: #2c2c2c;
border: 2px solid #444;
box-shadow: inset 0 0 20px rgba(0,0,0,0.5), 0 0 30px rgba(0,0,0,0.8);
}
#fps {
position: absolute;
top: 44px;
left: 44px;
font-size: 11px;
color: #0c0;
background: rgba(0,0,0,0.5);
padding: 2px 6px;
pointer-events: none;
z-index: 1;
}
canvas {
display: block;
background: #000;
image-rendering: pixelated;
}
.video-wrap {
margin-top: 48px;
margin-bottom: -40px;
width: 360px;
}
.video-wrap iframe {
width: 100%;
aspect-ratio: 16 / 9;
border: none;
border-radius: 4px;
}
/* ── README article ─────────────────────────── */
#readme {
max-width: 720px;
width: 100%;
padding: 60px 24px 80px;
line-height: 1.7;
font-size: 14px;
box-sizing: border-box;
}
#readme h1 {
font-size: 24px;
color: #e8e8e8;
margin: 0 0 8px;
border-bottom: 1px solid #333;
padding-bottom: 12px;
}
#readme h2 {
font-size: 19px;
color: #e0e0e0;
margin: 48px 0 16px;
border-bottom: 1px solid #2a2a2a;
padding-bottom: 8px;
}
#readme h3 {
font-size: 15px;
color: #d0d0d0;
margin: 32px 0 12px;
}
#readme p {
margin: 12px 0;
}
#readme ul, #readme ol {
padding-left: 24px;
margin: 12px 0;
}
#readme li {
margin: 6px 0;
}
#readme code {
background: #111;
padding: 2px 6px;
border-radius: 3px;
font-size: 13px;
}
#readme pre {
background: #111;
border: 1px solid #2a2a2a;
border-radius: 4px;
padding: 14px 16px;
overflow-x: auto;
margin: 16px 0;
line-height: 1.5;
}
#readme pre code {
background: none;
padding: 0;
font-size: 13px;
}
#readme hr {
border: none;
border-top: 1px solid #333;
margin: 48px 0;
}
#readme table {
width: 100%;
border-collapse: collapse;
margin: 16px 0;
font-size: 13px;
}
#readme th {
text-align: left;
padding: 8px 10px;
border-bottom: 2px solid #444;
color: #e0e0e0;
}
#readme td {
padding: 6px 10px;
border-bottom: 1px solid #2a2a2a;
}
#readme tr:nth-child(even) td {
background: rgba(255,255,255,0.02);
}
#readme strong {
color: #e0e0e0;
}
#readme a {
color: #7ab;
text-decoration: none;
}
#readme a:hover {
text-decoration: underline;
}
#readme blockquote {
border-left: 3px solid #444;
margin: 16px 0;
padding: 4px 16px;
color: #999;
}
</style>
</head>
<body>
<h1 class="site-title">From Pixels to Raytracing — A 3D Rendering Engine Built with Claude Code in Pure ES6+, Just Math and a Canvas</h1>
<div class="controls">
<label><input type="radio" name="renderMode" value="rasterize" id="rm-rasterize"> Software 3D (raster)</label>
<label><input type="radio" name="renderMode" value="raytrace" id="rm-raytrace"> Raytrace (CPU)</label>
<label><input type="radio" name="renderMode" value="gpu-raytrace" id="rm-gpu"> Raytrace (GPU calc offloaded)</label>
<label><input type="checkbox" id="aa-toggle"> AA (2×2)</label>
<button id="applyBtn">Apply</button>
</div>
<div class="frame">
<span id="fps">-- fps</span>
<canvas id="screen" width="800" height="420"></canvas>
</div>
<div class="video-wrap">
<p style="margin:0 0 8px;font-size:11px;color:#777;text-align:center">For nostalgic tunes press Play</p>
<iframe src="https://www.youtube.com/embed/lKJlkpdfe9g?modestbranding=1&rel=0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</div>
<article id="readme"></article>
<img id="skyImg" src="images/sky.jpg" style="display:none">
<script src="primitives.js"></script>
<script src="software-render.js"></script>
<script src="sphere.js"></script>
<script src="metaball.js"></script>
<script src="cube.js"></script>
<script src="floor.js"></script>
<script src="environment.js"></script>
<script src="render-common.js"></script>
<script src="raytrace-common.js"></script>
<script src="bvh.js"></script>
<script src="shader-source.js"></script>
<script src="raytrace.js"></script>
<script src="gpu-raytrace.js"></script>
<script src="main.js"></script>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script>
fetch('README.md')
.then(r => r.text())
.then(md => {
md = md.replace(/^# .+\n+/, '');
document.getElementById('readme').innerHTML = marked.parse(md);
// Add GitHub-style slug IDs to all headings so anchor links work
document.querySelectorAll('#readme h1, #readme h2, #readme h3').forEach(el => {
el.id = el.textContent.toLowerCase().replace(/\s*\u2014\s*/g, '--').replace(/[^\w\s-]/g, '').replace(/\s+/g, '-').trim();
});
});
</script>
</body>
</html>