-
Notifications
You must be signed in to change notification settings - Fork 14
ex using new debug draw aabb + added draw mesh obb in ex 12 #202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
keptsecret
wants to merge
31
commits into
master
Choose a base branch
from
new_debug_draw
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 23 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
88002c3
initial skeleton for debug draw ex
keptsecret 3df145b
use camera with lines
keptsecret ac56991
merge mesh_loaders
keptsecret 6d5a495
fixes from mesh_loader merge
keptsecret c5dae98
removed unused files
keptsecret 17b53a8
draw aabb from push constant
keptsecret a62cbed
move single aabb stuff into CDrawAABB
keptsecret 00185f2
Merge branch 'master' into new_debug_draw
keptsecret 5fa8874
default pipeline creation func
keptsecret 704a0fb
got streaming buffer working and drawing
keptsecret a81e62f
draw with instances
keptsecret da63edf
minor bug fix in creating instances
keptsecret 7469300
Merge branch 'master' into new_debug_draw
keptsecret 9ae72f5
move handling instances to CDrawAABB
keptsecret 7a22eef
moved most important streaming stuff to CDrawAABB
keptsecret f18bf38
moved most core func to CDrawAABB
keptsecret 09ef478
handle streaming buffer overflow
keptsecret aee85b4
update example scene
keptsecret 738269e
use debug draw extension
keptsecret c698bb7
Merge branch 'master' into new_debug_draw
keptsecret 61b1c00
removed old mesh loaders
keptsecret 4f1fabd
add debug aabb draws around mesh
keptsecret b31cfba
merge master, fix conflicts
keptsecret bfd286e
refactor debug_draw namespace
keptsecret 8518c2b
refactor remove usage of legacy matrices
keptsecret 323c782
refactor examples with latest DrawAabb changes
keptsecret f75dc21
use draw modes
keptsecret 83a71a8
Merge branch 'master' into new_debug_draw
keptsecret 347933d
merge master, fix conflicts
keptsecret 3b1016e
don't EXCLUDE_ALL new example
keptsecret 36171d7
Merge branch 'master' into new_debug_draw
keptsecret File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,29 @@ | ||
if(NBL_BUILD_DEBUG_DRAW) | ||
set(NBL_INCLUDE_SERACH_DIRECTORIES | ||
"${CMAKE_CURRENT_SOURCE_DIR}/include" | ||
) | ||
|
||
nbl_create_executable_project("${NBL_EXTRA_SOURCES}" "" "${NBL_INCLUDE_SERACH_DIRECTORIES}" "" "${NBL_EXECUTABLE_PROJECT_CREATION_PCH_TARGET}") | ||
|
||
add_dependencies(${EXECUTABLE_NAME} ${NBL_EXT_DEBUG_DRAW_TARGET}) | ||
target_link_libraries(${EXECUTABLE_NAME} PRIVATE ${NBL_EXT_DEBUG_DRAW_TARGET}) | ||
target_include_directories(${EXECUTABLE_NAME} PUBLIC $<TARGET_PROPERTY:${NBL_EXT_DEBUG_DRAW_TARGET},INCLUDE_DIRECTORIES>) | ||
|
||
if(NBL_EMBED_BUILTIN_RESOURCES) | ||
set(_BR_TARGET_ ${EXECUTABLE_NAME}_builtinResourceData) | ||
set(RESOURCE_DIR "app_resources") | ||
|
||
get_filename_component(_SEARCH_DIRECTORIES_ "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE) | ||
get_filename_component(_OUTPUT_DIRECTORY_SOURCE_ "${CMAKE_CURRENT_BINARY_DIR}/src" ABSOLUTE) | ||
get_filename_component(_OUTPUT_DIRECTORY_HEADER_ "${CMAKE_CURRENT_BINARY_DIR}/include" ABSOLUTE) | ||
|
||
file(GLOB_RECURSE BUILTIN_RESOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/${RESOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/${RESOURCE_DIR}/*") | ||
foreach(RES_FILE ${BUILTIN_RESOURCE_FILES}) | ||
LIST_BUILTIN_RESOURCE(RESOURCES_TO_EMBED "${RES_FILE}") | ||
endforeach() | ||
|
||
ADD_CUSTOM_BUILTIN_RESOURCES(${_BR_TARGET_} RESOURCES_TO_EMBED "${_SEARCH_DIRECTORIES_}" "${RESOURCE_DIR}" "nbl::this_example::builtin" "${_OUTPUT_DIRECTORY_HEADER_}" "${_OUTPUT_DIRECTORY_SOURCE_}") | ||
|
||
LINK_BUILTIN_RESOURCES_TO_TARGET(${EXECUTABLE_NAME} ${_BR_TARGET_}) | ||
endif() | ||
endif() |
This file contains hidden or 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,11 @@ | ||
#pragma shader_stage(fragment) | ||
|
||
#include "simple_common.hlsl" | ||
|
||
[shader("pixel")] | ||
float32_t4 main(PSInput input) : SV_TARGET | ||
{ | ||
float32_t4 outColor = input.color; | ||
|
||
return outColor; | ||
} |
This file contains hidden or 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,21 @@ | ||
#pragma shader_stage(vertex) | ||
|
||
#include "nbl/builtin/hlsl/bda/__ptr.hlsl" | ||
#include "simple_common.hlsl" | ||
|
||
using namespace nbl::hlsl; | ||
|
||
[[vk::push_constant]] SSimplePushConstants pc; | ||
|
||
[shader("vertex")] | ||
PSInput main(uint vertexID : SV_VertexID) | ||
{ | ||
PSInput output; | ||
|
||
float32_t3 vertex = (bda::__ptr<float32_t3>::create(pc.pVertices) + vertexID).deref_restrict().load(); | ||
|
||
output.position = mul(pc.MVP, float32_t4(vertex, 1)); | ||
output.color = float32_t4(1, 0, 0, 1); | ||
|
||
return output; | ||
} |
This file contains hidden or 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,24 @@ | ||
#ifndef _DRAW_AABB_SIMPLE_COMMON_HLSL | ||
#define _DRAW_AABB_SIMPLE_COMMON_HLSL | ||
|
||
#include "nbl/builtin/hlsl/cpp_compat.hlsl" | ||
|
||
struct SSimplePushConstants | ||
{ | ||
#ifdef __HLSL_VERSION | ||
float32_t4x4 MVP; | ||
#else | ||
float MVP[4*4]; | ||
#endif | ||
uint64_t pVertices; | ||
}; | ||
|
||
#ifdef __HLSL_VERSION | ||
struct PSInput | ||
{ | ||
float32_t4 position : SV_Position; | ||
float32_t4 color : TEXCOORD0; | ||
}; | ||
#endif | ||
|
||
#endif |
This file contains hidden or 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 @@ | ||
{ | ||
"enableParallelBuild": true, | ||
"threadsPerBuildProcess" : 2, | ||
"isExecuted": false, | ||
"scriptPath": "", | ||
"cmake": { | ||
"configurations": [ "Release", "Debug", "RelWithDebInfo" ], | ||
"buildModes": [], | ||
"requiredOptions": [] | ||
}, | ||
"profiles": [ | ||
{ | ||
"backend": "vulkan", | ||
"platform": "windows", | ||
"buildModes": [], | ||
"runConfiguration": "Release", | ||
"gpuArchitectures": [] | ||
} | ||
], | ||
"dependencies": [], | ||
"data": [ | ||
{ | ||
"dependencies": [], | ||
"command": [""], | ||
"outputs": [] | ||
} | ||
] | ||
} |
This file contains hidden or 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,23 @@ | ||
#ifndef __NBL_THIS_EXAMPLE_COMMON_H_INCLUDED__ | ||
#define __NBL_THIS_EXAMPLE_COMMON_H_INCLUDED__ | ||
|
||
#include <nabla.h> | ||
|
||
#include "nbl/examples/cameras/CCamera.hpp" | ||
#include "nbl/examples/common/SimpleWindowedApplication.hpp" | ||
#include "nbl/examples/common/CEventCallback.hpp" | ||
#include "nbl/examples/examples.hpp" | ||
|
||
//#include "nbl/CDrawAABB.h" | ||
#include "nbl/ext/DebugDraw/CDrawAABB.h" | ||
|
||
using namespace nbl; | ||
using namespace core; | ||
using namespace hlsl; | ||
using namespace system; | ||
using namespace asset; | ||
using namespace ui; | ||
using namespace video; | ||
using namespace nbl::examples; | ||
|
||
#endif // __NBL_THIS_EXAMPLE_COMMON_H_INCLUDED__ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.