CPU raytrace basic test
This commit is contained in:
parent
96576ea1ae
commit
e4d99058ad
1 changed files with 18 additions and 0 deletions
|
|
@ -3343,8 +3343,13 @@ void MapLoader::InitLightmap(MapData* map)
|
|||
|
||||
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);
|
||||
|
||||
|
||||
// Debug placeholder stuff
|
||||
{
|
||||
auto constructDebugTexture = [&](TArray<uint16_t>& buffer, int layers, int width, int height) {
|
||||
|
|
@ -3414,6 +3419,19 @@ void MapLoader::InitLightmap(MapData* map)
|
|||
ptr[1] = 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…
Add table
Add a link
Reference in a new issue