mirror of
https://github.com/Nexoniarz/Fry3DX.git
synced 2026-11-03 04:24:26 +00:00
Shapes with live settings, shape editing, knife and hole tools, drawing shapes onto other objects, combining objects (add / subtract / overlap), copies, thickness, painting with stickers and layers, a Layout tab, a Print tab with checks, packed .fry files with autosave, export to GLB, glTF, FBX, OBJ, 3MF, STL and PLY, folders in Layers, its own crash screen, and a website for GitHub Pages in docs/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NMSrd5oe1GpUD7E6d825KP
16 lines
705 B
GLSL
16 lines
705 B
GLSL
#ifndef KEEL_SKY_GLSL
|
|
#define KEEL_SKY_GLSL
|
|
// The sky (.ksky, engine/asset/ksky.h): equirectangular RGBM; level k is the sky as a surface
|
|
// of roughness k / top reflects it.
|
|
const float kSkyRange = 16.0;
|
|
|
|
// Radiance from direction `dir` (world space). yaw turns the photo so its sun lines up with
|
|
// the map's.
|
|
vec3 skyRadiance(uint tex, float intensity, float yaw, vec3 dir, float level) {
|
|
float c = cos(yaw), s = sin(yaw);
|
|
dir = vec3(c * dir.x + s * dir.y, -s * dir.x + c * dir.y, dir.z);
|
|
vec2 uv = vec2(atan(dir.y, dir.x) * 0.15915494 + 0.5, acos(clamp(dir.z, -1.0, 1.0)) * 0.31830989);
|
|
vec4 m = sampleTexLod(tex, uv, level);
|
|
return m.rgb * m.a * kSkyRange * intensity;
|
|
}
|
|
#endif
|