proto: first liminal fixtures - flat field + monolith, periodic hills, raised road in fog (L141)

Standalone only: fixtures, liminal_road_override (fillDais), --audit-liminal-road-walk, capture-only distance fog.
Road 65 m x 6 m, 22 m up, capsule walk 127/127. Owner hashes unchanged (v227), fast tier, Clang/GCC green.
Hills repeat every 80 m but the capture reaches 56 m, so only one rise shows. Also R48 (who owns the tunnel mouth):
recommends a bounded joint plan of passage ports and layer landing candidates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dhxM43dnWvUu2B5Ph1iG1
This commit is contained in:
Fr0zkaandClaude Opus 5.5 committed 2026-11-01 08:43:24 +01:00
1 parent eb47d72258
commit 9c6d261d01
15 files changed
+823 -12

No files matched your search

+70 -6
View File
@@ -592,6 +592,11 @@ uniform float uHeightCenter;
uniform float uHeightRange;
uniform float uTileEdgeWidth;
uniform vec3 uLightDirection;
uniform vec3 uCameraWorld;
uniform vec3 uFogColor;
uniform float uFogStart;
uniform float uFogEnd;
uniform int uFogEnabled;
uniform int uHeadlamp;
uniform int uGrazingLight;
uniform int uClipEnabled;
@@ -643,6 +648,11 @@ void main()
color=mix(color,resourceColor/max(resourceWeight,0.001),
clamp(resourceWeight,0.0,0.95))*illumination;
}
if(uFogEnabled!=0)
{
float fogT=smoothstep(uFogStart,uFogEnd,length(vWorldPosition-uCameraWorld));
color=mix(color,uFogColor,fogT);
}
if(uTileEdges!=0&&vTileData.z>0.0)
{
vec2 local=mod(vWorldPosition.xy-vTileData.xy,vTileData.z);
@@ -707,7 +717,8 @@ void main()
bool HeightTint,bool Headlamp,bool TileEdges,
double TileEdgeWidthMeters,bool HasLightDirection,
const std::array<double,3>& LightDirection,bool ClipPlaneEnabled,
const std::array<double,4>& ClipPlane)
const std::array<double,4>& ClipPlane,bool FogEnabled,
double FogStartMeters,double FogEndMeters,const std::array<double,3>& FogColor)
{
EGLDisplay Display=MakeDisplay();
EGLint Major=0,Minor=0;
@@ -796,7 +807,10 @@ void main()
glViewport(0,0,Width,Height);glDisable(GL_CULL_FACE);glEnable(GL_DEPTH_TEST);
// A covered empty ray represents open air. Keep it visibly blue so it cannot
// be mistaken for the old near-black result from a scene that lacked tiles.
glDepthFunc(GL_LEQUAL);glClearColor(0.30f,0.48f,0.62f,1.0f);
glDepthFunc(GL_LEQUAL);
glClearColor(FogEnabled?static_cast<float>(FogColor[0]):0.30f,
FogEnabled?static_cast<float>(FogColor[1]):0.48f,
FogEnabled?static_cast<float>(FogColor[2]):0.62f,1.0f);
glClearDepthf(1.0f);glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glUseProgram(Program);
glUniform1f(glGetUniformLocation(Program,"uTanHalfHorizontal"),static_cast<float>(TanHalfHorizontal));
@@ -825,6 +839,18 @@ void main()
static_cast<float>(ActiveLightDirection[0]),
static_cast<float>(ActiveLightDirection[1]),
static_cast<float>(ActiveLightDirection[2]));
glUniform3f(glGetUniformLocation(Program,"uCameraWorld"),
static_cast<float>(Scene.CameraMeters[0]),
static_cast<float>(Scene.CameraMeters[1]),
static_cast<float>(Scene.CameraMeters[2]));
glUniform3f(glGetUniformLocation(Program,"uFogColor"),
static_cast<float>(FogColor[0]),static_cast<float>(FogColor[1]),
static_cast<float>(FogColor[2]));
glUniform1f(glGetUniformLocation(Program,"uFogStart"),
static_cast<float>(FogStartMeters));
glUniform1f(glGetUniformLocation(Program,"uFogEnd"),
static_cast<float>(FogEndMeters));
glUniform1i(glGetUniformLocation(Program,"uFogEnabled"),FogEnabled?1:0);
glDrawElements(GL_TRIANGLES,static_cast<GLsizei>(Scene.Indices.size()),GL_UNSIGNED_INT,nullptr);
glFinish();
std::vector<std::uint8_t> Pixels(static_cast<std::size_t>(Width)*Height*4);
@@ -863,7 +889,7 @@ int main(int argc,char** argv)
if(argc==2&&std::string_view(argv[1])=="--print-source-stamp")return 0;
if(argc<3)
{
std::fprintf(stderr,"Usage: %s scene.vfmesh output.png [--size=WIDTHxHEIGHT] [--fov-deg=90] [--height-range-m=N] [--height-center-m=N] [--camera-m=X,Y,Z] [--yaw-deg=N] [--pitch-deg=N] [--shade=readable|normal] [--height-tint=on|off] [--headlamp=on|off] [--light-direction=X,Y,Z] [--tile-edges=on|off] [--tile-skirts=on|off] [--tile-edge-width-m=N] [--clip-plane=NX,NY,NZ,D] [--focus-region=X,Y,Z,R]\n",argv[0]);
std::fprintf(stderr,"Usage: %s scene.vfmesh output.png [--size=WIDTHxHEIGHT] [--fov-deg=90] [--height-range-m=N] [--height-center-m=N] [--camera-m=X,Y,Z] [--yaw-deg=N] [--pitch-deg=N] [--shade=readable|normal] [--height-tint=on|off] [--headlamp=on|off] [--light-direction=X,Y,Z] [--fog=on|off] [--fog-start-m=N] [--fog-end-m=N] [--fog-color=R,G,B] [--tile-edges=on|off] [--tile-skirts=on|off] [--tile-edge-width-m=N] [--clip-plane=NX,NY,NZ,D] [--focus-region=X,Y,Z,R]\n",argv[0]);
return 2;
}
int Width=2560,Height=1440;double Fov=90.0,HeightRangeMeters=64.0;
@@ -871,6 +897,8 @@ int main(int argc,char** argv)
bool HasYaw=false,HasPitch=false;double Yaw=0.0,Pitch=0.0;
bool HasCamera=false;std::array<double,3> Camera{};
bool HasLightDirection=false;std::array<double,3> LightDirection{};
bool FogEnabled=false;double FogStartMeters=50.0,FogEndMeters=200.0;
std::array<double,3> FogColor={0.62,0.70,0.75};
bool ReadableMode=true,HeightTint=true,TileEdges=false,TileSkirts=true,Headlamp=false;
double TileEdgeWidthMeters=0.15;
bool ClipPlaneEnabled=false;std::array<double,4> ClipPlane{};
@@ -967,6 +995,38 @@ int main(int argc,char** argv)
{std::fprintf(stderr,"Invalid light direction; use X,Y,Z with non-zero length\n");return 2;}
HasLightDirection=true;
}
else if(Arg.starts_with("--fog="))
{
const std::string_view Mode=Arg.substr(6);
if(Mode=="on")FogEnabled=true;
else if(Mode=="off")FogEnabled=false;
else {std::fprintf(stderr,"Invalid fog mode\n");return 2;}
}
else if(Arg.starts_with("--fog-start-m="))
{
char* End=nullptr;const std::string Value(Arg.substr(14));
FogStartMeters=std::strtod(Value.c_str(),&End);
if(End==Value.c_str()||*End!='\0'||!std::isfinite(FogStartMeters)
||FogStartMeters<0.0||FogStartMeters>20000.0)
{std::fprintf(stderr,"Invalid fog start distance\n");return 2;}
}
else if(Arg.starts_with("--fog-end-m="))
{
char* End=nullptr;const std::string Value(Arg.substr(12));
FogEndMeters=std::strtod(Value.c_str(),&End);
if(End==Value.c_str()||*End!='\0'||!std::isfinite(FogEndMeters)
||FogEndMeters<=0.0||FogEndMeters>20000.0)
{std::fprintf(stderr,"Invalid fog end distance\n");return 2;}
}
else if(Arg.starts_with("--fog-color="))
{
const std::string Value(Arg.substr(12));
if(std::sscanf(Value.c_str(),"%lf,%lf,%lf",&FogColor[0],&FogColor[1],
&FogColor[2])!=3
||std::any_of(FogColor.begin(),FogColor.end(),[](double Channel)
{return !std::isfinite(Channel)||Channel<0.0||Channel>1.0;}))
{std::fprintf(stderr,"Invalid fog color; use R,G,B in 0..1\n");return 2;}
}
else if(Arg.starts_with("--tile-edges="))
{
const std::string_view Mode=Arg.substr(13);
@@ -1002,6 +1062,8 @@ int main(int argc,char** argv)
}
else {std::fprintf(stderr,"Unknown option: %.*s\n",static_cast<int>(Arg.size()),Arg.data());return 2;}
}
if(FogEnabled&&FogEndMeters<=FogStartMeters)
{std::fprintf(stderr,"Fog end distance must be greater than fog start distance\n");return 2;}
FScene Scene;std::string Error;
if(!LoadScene(argv[1],Scene,Error))
{std::fprintf(stderr,"[OffscreenCapture] FAIL: %s\n",Error.c_str());return 2;}
@@ -1077,14 +1139,16 @@ int main(int argc,char** argv)
FocusRadius,static_cast<unsigned long long>(Scene.DrawnTriangles));
}
}
std::printf("[OffscreenScene] voxels_per_meter=%.6f camera_m=(%.3f,%.3f,%.3f) yaw=%.2f pitch=%.2f height_m=%.3f..%.3f height_center_m=%.3f shade=%s height_tint=%s tile_edges=%s vertices=%zu triangles=%llu\n",
std::printf("[OffscreenScene] voxels_per_meter=%.6f camera_m=(%.3f,%.3f,%.3f) yaw=%.2f pitch=%.2f height_m=%.3f..%.3f height_center_m=%.3f shade=%s height_tint=%s tile_edges=%s fog=%s fog_distance_m=%.1f..%.1f fog_color=(%.2f,%.2f,%.2f) vertices=%zu triangles=%llu\n",
1000000.0/Scene.VoxelSizeMicrons,Scene.CameraMeters[0],Scene.CameraMeters[1],Scene.CameraMeters[2],
Scene.YawDegrees,Scene.PitchDegrees,Scene.MinimumHeight,Scene.MaximumHeight,
HeightCenterMeters,
ReadableMode?"readable":"normal",HeightTint?"on":"off",
TileEdges?"on":"off",Scene.Vertices.size(),
TileEdges?"on":"off",FogEnabled?"on":"off",FogStartMeters,FogEndMeters,
FogColor[0],FogColor[1],FogColor[2],Scene.Vertices.size(),
static_cast<unsigned long long>(Scene.Triangles));
return Render(Scene,argv[2],Width,Height,Fov,HeightRangeMeters,HeightCenterMeters,ReadableMode,
HeightTint,Headlamp,TileEdges,
TileEdgeWidthMeters,HasLightDirection,LightDirection,ClipPlaneEnabled,ClipPlane)?0:3;
TileEdgeWidthMeters,HasLightDirection,LightDirection,ClipPlaneEnabled,ClipPlane,
FogEnabled,FogStartMeters,FogEndMeters,FogColor)?0:3;
}