Skip to content
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

Implement sub-sampling in raytracing code #277

Merged
merged 2 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions include/rgl/api/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,15 @@ typedef enum : int32_t
RGL_FIELD_DYNAMIC_FORMAT = 13842,
} rgl_field_t;

/**
* Kinds of return type for multi-return LiDAR output.
*/
typedef enum : int32_t
msz-rai marked this conversation as resolved.
Show resolved Hide resolved
{
RGL_RETURN_TYPE_FIRST = 0,
RGL_RETURN_TYPE_LAST = 1,
} rgl_return_type_t;

/**
* Helper enum for axis selection
*/
Expand Down
28 changes: 28 additions & 0 deletions src/gpu/MultiReturn.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright 2024 Robotec.AI
//
// 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.

#pragma once

#include <RGLFields.hpp>

#define MULTI_RETURN_BEAM_VERTICES 8
#define MULTI_RETURN_BEAM_CIRCLES 2
#define MULTI_RETURN_BEAM_SAMPLES (1 + (MULTI_RETURN_BEAM_VERTICES * MULTI_RETURN_BEAM_CIRCLES))

struct MultiReturnPointers
{
Field<IS_HIT_I32>::type* isHit;
Field<XYZ_VEC3_F32>::type* xyz;
Field<DISTANCE_F32>::type* distance;
};
7 changes: 6 additions & 1 deletion src/gpu/RaytraceRequestContext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <optix.h>
#include <RGLFields.hpp>
#include <gpu/MultiReturn.hpp>

struct RaytraceRequestContext
{
Expand All @@ -38,7 +39,7 @@ struct RaytraceRequestContext
const int* ringIds;
size_t ringIdsCount;

const float* rayTimeOffsets;
const float* rayTimeOffsetsMs;
size_t rayTimeOffsetsCount;

OptixTraversableHandle scene;
Expand All @@ -61,5 +62,9 @@ struct RaytraceRequestContext
Field<ELEVATION_F32>::type* elevation;
Field<NORMAL_VEC3_F32>::type* normal;
Field<INCIDENT_ANGLE_F32>::type* incidentAngle;

// Multi-Return
float beamHalfDivergence;
MultiReturnPointers mrSamples;
};
static_assert(std::is_trivially_copyable<RaytraceRequestContext>::value);
Loading
Loading