Skip to content

Commit

Permalink
Add Mobile NeRF Ray Query Sample (KhronosGroup#1134)
Browse files Browse the repository at this point in the history
* Add Mobile NeRF Ray Query sample initial files

Signed-off-by: Rodrigo Holztrattner <[email protected]>

* Quick fixes

Signed-off-by: Rodrigo Holztrattner <[email protected]>

* Add missing device properties 2 extension

Signed-off-by: Rodrigo Holztrattner <[email protected]>

* Minor README fix (remove repeated word)

Signed-off-by: Rodrigo Holztrattner <[email protected]>

* Fix for pending shader and cast issues

Signed-off-by: Rodrigo Holztrattner <[email protected]>

* Address camera movement and a few minor issues

Signed-off-by: Rodrigo Holztrattner <[email protected]>

* Update GPU feature request logic and minor change at readme file (Adreno -> mobile devices that support ray queries)

* Fix for missing shader uniform buffer array non uniform indexing

Signed-off-by: Rodrigo Holztrattner <[email protected]>

* Remove unused variable

Signed-off-by: Rodrigo Holztrattner <[email protected]>

* Change default model to USE_OPAQUE

Signed-off-by: Rodrigo Holztrattner <[email protected]>

---------

Signed-off-by: Rodrigo Holztrattner <[email protected]>
  • Loading branch information
RodrigoHolztrattner-QuIC authored Nov 4, 2024
1 parent 58ba96a commit 96887d8
Show file tree
Hide file tree
Showing 9 changed files with 2,223 additions and 1 deletion.
1 change: 1 addition & 0 deletions antora/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
** xref:samples/tooling/profiles/README.adoc[Profiles]
* xref:samples/general/README.adoc[General samples]
** xref:samples/general/mobile_nerf/README.adoc[Mobile NeRF]
** xref:samples/general/mobile_nerf_rayquery/README.adoc[Mobile NeRF Ray Query]
* xref:docs/README.adoc[General documentation]
** xref:docs/build.adoc[Build guide]
** xref:docs/memory_limits.adoc[Memory limits]
Expand Down
6 changes: 5 additions & 1 deletion samples/general/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ The goal of these samples is to demonstrate different techniques or showcase com

=== xref:./{general_samplespath}mobile_nerf/README.adoc[Mobile NeRF]

A Neural Radiance Field synthesizer sample, based on textured polygons.
A Neural Radiance Field synthesizer sample, based on textured polygons.

=== xref:./{general_samplespath}mobile_nerf_rayquery/README.adoc[Mobile NeRF Ray Query]

A Mobile Neural Radiance Field synthesizer sample using ray query, based on textured polygons.
31 changes: 31 additions & 0 deletions samples/general/mobile_nerf_rayquery/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 the "License";
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

get_filename_component(FOLDER_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
get_filename_component(PARENT_DIR ${CMAKE_CURRENT_LIST_DIR} PATH)
get_filename_component(CATEGORY_NAME ${PARENT_DIR} NAME)

add_sample_with_tags(
ID ${FOLDER_NAME}
CATEGORY ${CATEGORY_NAME}
AUTHOR "Qualcomm"
NAME "Mobile NeRF Ray Query"
DESCRIPTION "A Mobile Neural Radiance Field synthesizer sample using ray query, based on textured polygons."
SHADER_FILES_GLSL
"mobile_nerf_rayquery/quad.vert"
"mobile_nerf_rayquery/rayquery_morpheus_combo.frag"
"mobile_nerf_rayquery/rayquery_morpheus.frag")
33 changes: 33 additions & 0 deletions samples/general/mobile_nerf_rayquery/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
////
- Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved
-
- SPDX-License-Identifier: Apache-2.0
-
- Licensed under the Apache License, Version 2.0 the "License";
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
////
= Mobile NeRF Ray Query

ifdef::site-gen-antora[]
TIP: The source for this sample can be found in the https://github.com/KhronosGroup/Vulkan-Samples/tree/main/samples/general/mobile_nerf_rayquery[Khronos Vulkan samples github repository].
endif::[]

NeRF is a new 3D representation method in Computer Vision that creates images of a 3D scene using several 2D pictures taken from different viewpoints.
This method constructs a representation of the 3D volume. Various adaptations of NeRF target different use cases, including MobileNeRF, which focuses on rendering NeRF efficiently on mobile phones by leveraging existing traditional graphic hardware.

This version enhances the https://github.com/KhronosGroup/Vulkan-Samples/tree/main/samples/general/mobile_nerf[previous MobileNeRF implementation] by using the Vulkan Ray Query feature, which leverages the hardware ray tracing capabilities of mobile GPUs that support it.
This enhancement greatly boosts performance in most use cases. Additionally, the Vulkan API provides great flexibility for modifying and optimizing the rendering pipeline and shaders, enabling more functionalities while delivering optimal performance.

== Notes
The original source code is also licensed under Apache-2.0, all shader files used by the sample have comments to indicate changes, when applicable.
Loading

0 comments on commit 96887d8

Please sign in to comment.