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
// compute previous pose | |
void IOptixEngine::srt_previous(float * key, ItemHandle item) | |
{ | |
Eigen::Vector3f p = item->spaceTime().previousWorldTransform.translation(); | |
Eigen::Vector3f s = item->spaceTime().scale; | |
// model bounds works, world bounds does not! | |
Eigen::AlignedBox3f bbox = item->spaceTime().modelBound; | |
Eigen::Vector3f pivot = bbox.center(); |
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
struct PickParams | |
{ | |
int picking; | |
float3 rayOrigin; | |
float3 rayDir; | |
int32_t pickData[2]; | |
OptixTraversableHandle sceneAccel; | |
}; | |
enum RayType |
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
struct PickingParams | |
{ | |
OptixTraversableHandle sceneAccel; | |
float4* accum_buffer; | |
uchar4* frame_buffer; | |
CUdeviceptr pickBuffer; // CUDA device pointer with room for at least two unsigned int. | |
// 4-byte aligned | |
uint32_t subframe_index; | |
int picking; |
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
size_t byteOffset = 0; | |
// indices | |
indices.data = deviceBuffer + byteOffset; | |
indices.byte_stride = static_cast<uint16_t>(byteStride); | |
indices.count = static_cast<uint32_t>(tris.size()); | |
indices.elmt_byte_size = static_cast<uint16_t>(sizeof(uint32_t)); | |
uintptr_t number = (uintptr_t)indices.data; |
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
#pragma once | |
#include "bare_bones_shared.h" | |
using namespace Shared; | |
using namespace BarebonesShared; | |
RT_PIPELINE_LAUNCH_PARAMETERS PipelineLaunchParameters plp; | |
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
// tracing algorithms. Yocto/Shading is implemented in `yocto_shading.h`. | |
// | |
// | |
// LICENSE: | |
// | |
// Copyright (c) 2016 -- 2020 Fabio Pellacini | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal |
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
taken from https://github.com/shocker-0x15/OptiX_Utility | |
class Timer { | |
CUcontext m_context; | |
CUevent m_startEvent; | |
CUevent m_endEvent; | |
bool m_startIsValid; | |
bool m_endIsValid; | |
public: |
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
#pragma once | |
// Define types and functions on the host corresponding to CUDA built-ins. | |
#if !defined(__CUDACC__) || defined(OPTIXU_Platform_CodeCompletion) | |
// This code defines a struct named "int2" that contains two 32-bit integers named "x" and "y". | |
// The line "struct alignas (8) int2" specifies that the struct should be aligned on an 8-byte boundary in memory. | |
// This can be used to optimize memory access performance in certain situations. | |
// The code also provides two constructors for the struct. The first constructor takes a | |
// single 32-bit integer "v" and initializes both "x" and "y" to that value. |