mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-02-17 01:31:25 +00:00
CPU raytrace basic test
This commit is contained in:
parent
73030b9315
commit
3af8f477e7
1 changed files with 18 additions and 0 deletions
|
@ -3338,8 +3338,13 @@ void MapLoader::InitLightmap(MapData* map)
|
||||||
|
|
||||||
Level->LMTextureSize = 1024; // TODO cvar
|
Level->LMTextureSize = 1024; // TODO cvar
|
||||||
|
|
||||||
|
// TODO read from ZDRayInfoThing
|
||||||
|
Level->SunColor = FVector3(1.f, 1.f, 1.f);
|
||||||
|
Level->SunDirection = FVector3(0.45f, 0.3f, 0.9f);
|
||||||
|
|
||||||
Level->LMTextureCount = Level->levelMesh->SetupLightmapUvs(Level->LMTextureSize);
|
Level->LMTextureCount = Level->levelMesh->SetupLightmapUvs(Level->LMTextureSize);
|
||||||
|
|
||||||
|
|
||||||
// Debug placeholder stuff
|
// Debug placeholder stuff
|
||||||
{
|
{
|
||||||
auto constructDebugTexture = [&](TArray<uint16_t>& buffer, int layers, int width, int height) {
|
auto constructDebugTexture = [&](TArray<uint16_t>& buffer, int layers, int width, int height) {
|
||||||
|
@ -3409,6 +3414,19 @@ void MapLoader::InitLightmap(MapData* map)
|
||||||
ptr[1] = floatToHalf(0.0f);
|
ptr[1] = floatToHalf(0.0f);
|
||||||
ptr[2] = floatToHalf(0.0f);
|
ptr[2] = floatToHalf(0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Level->levelMesh->TraceSky(surface.worldOrigin - surface.worldStepX - surface.worldStepY + surface.worldStepX * x + surface.worldStepY * y + FVector3(surface.plane.Normal()), Level->SunDirection, 32000.0f))
|
||||||
|
{
|
||||||
|
ptr[0] = floatToHalf(Level->SunColor.X);
|
||||||
|
ptr[1] = floatToHalf(Level->SunColor.Y);
|
||||||
|
ptr[2] = floatToHalf(Level->SunColor.Z);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ptr[0] = 0;
|
||||||
|
ptr[1] = 0;
|
||||||
|
ptr[2] = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue