Skip to content

Commit ccb7b4a

Browse files
committed
Merge branch 'tgeotex_streaming'
2 parents 5080b10 + 4d7a747 commit ccb7b4a

28 files changed

Lines changed: 2692 additions & 989 deletions

24_ColorSpaceTest/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ class ColorSpaceTestSampleApp final : public SimpleWindowedApplication, public B
541541
struct
542542
{
543543
std::string path;
544-
json data;
544+
::json data;
545545
} current, reference;
546546

547547
current.path = (localOutputCWD / filename).make_preferred().string() + "_" + modeAsString + extension.string() + ".json";
@@ -552,7 +552,7 @@ class ColorSpaceTestSampleApp final : public SimpleWindowedApplication, public B
552552
m_logger->log("Mode: \"%s\"", ILogger::ELL_INFO, modeAsString.c_str());
553553
m_logger->log("Writing \"%ls\"'s image hash to \"%s\"", ILogger::ELL_INFO, filename.c_str(), current.path.c_str());
554554

555-
current.data["image"] = json::array();
555+
current.data["image"] = ::json::array();
556556
for (const auto& it : hash)
557557
current.data["image"].push_back(it);
558558

62_CAD/CMakeLists.txt

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,13 @@ set(EXAMPLE_SOURCES
1414
"${CMAKE_CURRENT_SOURCE_DIR}/DrawResourcesFiller.h"
1515
"${CMAKE_CURRENT_SOURCE_DIR}/SingleLineText.cpp"
1616
"${CMAKE_CURRENT_SOURCE_DIR}/SingleLineText.h"
17-
"${CMAKE_CURRENT_SOURCE_DIR}/GeoTexture.cpp"
18-
"${CMAKE_CURRENT_SOURCE_DIR}/GeoTexture.h"
17+
"${CMAKE_CURRENT_SOURCE_DIR}/Images.cpp"
1918
"../../src/nbl/ext/TextRendering/TextRendering.cpp" # TODO: this one will be a part of dedicated Nabla ext called "TextRendering" later on which uses MSDF + Freetype
2019
)
2120
set(EXAMPLE_INCLUDES
2221
"${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/boost/superproject/libs/math/include")
2322
nbl_create_executable_project("${EXAMPLE_SOURCES}" "" "${EXAMPLE_INCLUDES}" "" "${NBL_EXECUTABLE_PROJECT_CREATION_PCH_TARGET}")
24-
25-
if(NBL_EMBED_BUILTIN_RESOURCES)
26-
set(_BR_TARGET_ ${EXECUTABLE_NAME}_builtinResourceData)
27-
set(RESOURCE_DIR "app_resources")
28-
29-
get_filename_component(_SEARCH_DIRECTORIES_ "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE)
30-
get_filename_component(_OUTPUT_DIRECTORY_SOURCE_ "${CMAKE_CURRENT_BINARY_DIR}/src" ABSOLUTE)
31-
get_filename_component(_OUTPUT_DIRECTORY_HEADER_ "${CMAKE_CURRENT_BINARY_DIR}/include" ABSOLUTE)
32-
33-
file(GLOB_RECURSE BUILTIN_RESOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/${RESOURCE_DIR}" CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${RESOURCE_DIR}/*")
34-
foreach(RES_FILE ${BUILTIN_RESOURCE_FILES})
35-
LIST_BUILTIN_RESOURCE(RESOURCES_TO_EMBED "${RES_FILE}")
36-
endforeach()
37-
38-
ADD_CUSTOM_BUILTIN_RESOURCES(${_BR_TARGET_} RESOURCES_TO_EMBED "${_SEARCH_DIRECTORIES_}" "${RESOURCE_DIR}" "nbl::this_example::builtin" "${_OUTPUT_DIRECTORY_HEADER_}" "${_OUTPUT_DIRECTORY_SOURCE_}")
39-
40-
LINK_BUILTIN_RESOURCES_TO_TARGET(${EXECUTABLE_NAME} ${_BR_TARGET_})
41-
endif()
23+
target_link_libraries(${EXECUTABLE_NAME} PRIVATE Nabla::ext::FullScreenTriangle)
4224

4325
# if enabled then try use Nabla "Text Rendering" extension
4426
# with an implemented interface using the 3rdparty deps
@@ -83,7 +65,7 @@ set(JSON [=[
8365
"CAPS": [${REQUIRED_CAPS}]
8466
},
8567
{
86-
"INPUT": "shaders/main_pipeline/fragment.hlsl",
68+
"INPUT": "shaders/main_pipeline/all_fragment_shaders.hlsl",
8769
"KEY": "main_pipeline_fragment_shader",
8870
"CAPS": [${REQUIRED_CAPS}]
8971
}

62_CAD/DrawResourcesFiller.cpp

Lines changed: 874 additions & 435 deletions
Large diffs are not rendered by default.

62_CAD/DrawResourcesFiller.h

Lines changed: 232 additions & 60 deletions
Large diffs are not rendered by default.

62_CAD/GeoTexture.cpp

Lines changed: 0 additions & 117 deletions
This file was deleted.

62_CAD/GeoTexture.h

Lines changed: 0 additions & 64 deletions
This file was deleted.

62_CAD/Hatch.cpp

Lines changed: 45 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ static constexpr float64_t FillPatternShapeExtent = 32.0;
812812

813813
void line(std::vector<CPolyline>& polylines, float64_t2 begin, float64_t2 end)
814814
{
815-
std::vector<float64_t2> points = {
815+
std::array<float64_t2, 2> points = {
816816
begin, end
817817
};
818818
CPolyline polyline;
@@ -846,15 +846,23 @@ void checkered(std::vector<CPolyline>& polylines, const float64_t2& offset)
846846
float64_t2(0.0, 1.0),
847847
};
848848
{
849-
std::vector<float64_t2> points;
850-
points.reserve(squarePointsCW.size());
851-
for (const auto& p : squarePointsCW) points.push_back(p * FillPatternShapeExtent + offset);
849+
std::array<float64_t2, 5> points;
850+
auto i = 0u;
851+
for (const auto& p : squarePointsCW)
852+
{
853+
points[i] = p * FillPatternShapeExtent + offset;
854+
i++;
855+
}
852856
polyline.addLinePoints(points);
853857
}
854858
{
855-
std::vector<float64_t2> points;
856-
points.reserve(squarePointsCW.size());
857-
for (const auto& p : squarePointsCW) points.push_back((p + float64_t2(0.5, -0.5)) * FillPatternShapeExtent + offset);
859+
std::array<float64_t2, 5> points;
860+
auto i = 0u;
861+
for (const auto& p : squarePointsCW)
862+
{
863+
points[i] = (p + float64_t2(0.5, -0.5)) * FillPatternShapeExtent + offset;
864+
i++;
865+
}
858866
polyline.addLinePoints(points);
859867
}
860868
polylines.push_back(std::move(polyline));
@@ -885,16 +893,24 @@ void diamonds(std::vector<CPolyline>& polylines, const float64_t2& offset)
885893

886894
// Outer
887895
{
888-
std::vector<float64_t2> points;
889-
points.reserve(diamondPointsCW.size());
890-
for (const auto& p : diamondPointsCW) points.push_back(p * outerSize + origin);
896+
std::array<float64_t2, 5> points;
897+
auto i = 0u;
898+
for (const auto& p : diamondPointsCW)
899+
{
900+
points[i] = p * outerSize + origin;
901+
i++;
902+
}
891903
polyline.addLinePoints(points);
892904
}
893905
// Inner
894906
{
895-
std::vector<float64_t2> points;
896-
points.reserve(diamondPointsCCW.size());
897-
for (const auto& p : diamondPointsCCW) points.push_back(p * innerSize + origin);
907+
std::array<float64_t2, 5> points;
908+
auto i = 0u;
909+
for (const auto& p : diamondPointsCCW)
910+
{
911+
points[i] = p * innerSize + origin;
912+
i++;
913+
}
898914
polyline.addLinePoints(points);
899915
}
900916
polylines.push_back(std::move(polyline));
@@ -915,9 +931,13 @@ void crossHatch(std::vector<CPolyline>& polylines, const float64_t2& offset)
915931
float64_t2(0.375, 0.0),
916932
};
917933
{
918-
std::vector<float64_t2> points;
919-
points.reserve(outerPointsCW.size());
920-
for (const auto& p : outerPointsCW) points.push_back(p * FillPatternShapeExtent + offset);
934+
std::array<float64_t2, 9u> points;
935+
auto i = 0u;
936+
for (const auto& p : outerPointsCW)
937+
{
938+
points[i] = p * FillPatternShapeExtent + offset;
939+
i++;
940+
}
921941
polyline.addLinePoints(points);
922942
}
923943

@@ -930,9 +950,13 @@ void crossHatch(std::vector<CPolyline>& polylines, const float64_t2& offset)
930950
};
931951
{
932952
float64_t2 origin = float64_t2(FillPatternShapeExtent/2.0, FillPatternShapeExtent/2.0) + offset;
933-
std::vector<float64_t2> points;
934-
points.reserve(diamondPointsCCW.size());
935-
for (const auto& p : diamondPointsCCW) points.push_back(p * 0.75 * FillPatternShapeExtent + origin);
953+
std::array<float64_t2, 5u> points;
954+
auto i = 0u;
955+
for (const auto& p : diamondPointsCCW)
956+
{
957+
points[i] = p * 0.75 * FillPatternShapeExtent + origin;
958+
i++;
959+
}
936960
polyline.addLinePoints(points);
937961
}
938962
polylines.push_back(std::move(polyline));
@@ -948,7 +972,7 @@ void hatch(std::vector<CPolyline>& polylines, const float64_t2& offset)
948972
{
949973
float64_t2 radiusOffsetTL = float64_t2(+lineDiameter / 2.0, +lineDiameter / 2.0) * FillPatternShapeExtent / 8.0;
950974
float64_t2 radiusOffsetBL = float64_t2(-lineDiameter / 2.0, -lineDiameter / 2.0) * FillPatternShapeExtent / 8.0;
951-
std::vector<float64_t2> points = {
975+
std::array<float64_t2, 5u> points = {
952976
basePt0 + radiusOffsetTL,
953977
basePt0 + radiusOffsetBL, // 0
954978
basePt1 + radiusOffsetBL, // 1
@@ -1052,7 +1076,7 @@ void reverseHatch(std::vector<CPolyline>& polylines, const float64_t2& offset)
10521076
{
10531077
float64_t2 radiusOffsetTL = float64_t2(-lineDiameter / 2.0, +lineDiameter / 2.0) * FillPatternShapeExtent / 8.0;
10541078
float64_t2 radiusOffsetBL = float64_t2(+lineDiameter / 2.0, -lineDiameter / 2.0) * FillPatternShapeExtent / 8.0;
1055-
std::vector<float64_t2> points = {
1079+
std::array<float64_t2, 5u> points = {
10561080
basePt0 + radiusOffsetTL,
10571081
basePt1 + radiusOffsetTL, // 0
10581082
basePt1 + radiusOffsetBL, // 1

0 commit comments

Comments
 (0)