-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- implement line-of-sight check from VOBs to their static lights based on world mesh geometry - improve debug rendering - implement line-of-sight ray debug line rendering - fix rayDownIntersectsFaceBB for naive impl - implement SRGB to linear conversion for any colors / lights loaded from ZEN, apply conversion also to light weights
- Loading branch information
Showing
14 changed files
with
204 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -252,4 +252,5 @@ imgui.ini | |
/ZenRen/lib/imgui/misc/ | ||
/ZenRen/data_* | ||
*.tlog | ||
*.log.txt | ||
*.log.txt | ||
/tmp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include "stdafx.h" | ||
#include "StaticLightFromVobLight.h" | ||
|
||
#include "MeshUtil.h" | ||
|
||
namespace renderer::loader | ||
{ | ||
using namespace DirectX; | ||
using ::std::vector; | ||
using ::std::unordered_map; | ||
|
||
bool rayIntersectsWorldFaces(XMVECTOR rayStart, XMVECTOR rayEnd, float maxDistance, const unordered_map<Material, VEC_VERTEX_DATA>& meshData, const VertLookupTree& vertLookup) | ||
{ | ||
XMVECTOR direction = DirectX::XMVector3Normalize(rayEnd - rayStart); | ||
vector<VertKey> vertKeys = rayIntersected(vertLookup, toVec3(rayStart), toVec3(rayEnd)); | ||
for (auto& vertKey : vertKeys) { | ||
auto& face = vertKey.getPos(meshData); | ||
XMVECTOR faceA = toXM4Pos(face[0]); | ||
XMVECTOR faceB = toXM4Pos(face[1]); | ||
XMVECTOR faceC = toXM4Pos(face[2]); | ||
float distance; | ||
bool intersects = TriangleTests::Intersects(rayStart, direction, faceA, faceB, faceC, distance); | ||
if (intersects && distance <= maxDistance) { | ||
return true; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#pragma once | ||
|
||
#include "../RendererCommon.h" | ||
#include "VertPosLookup.h" | ||
|
||
namespace renderer::loader | ||
{ | ||
bool rayIntersectsWorldFaces(DirectX::XMVECTOR rayStart, DirectX::XMVECTOR rayEnd, float maxDistance, const std::unordered_map<Material, VEC_VERTEX_DATA>& meshData, const VertLookupTree& vertLookup); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.