shocker-0x15 / OptiX_Utility

OptiX 8 Lightweight Wrapper Library
Other
100 stars 8 forks source link

Start from empty scene #1

Closed Hurleyworks closed 4 years ago

Hurleyworks commented 4 years ago

Hello,

Thanks for making this project. It seems really well designed!

I would like to use it in my projects. Can you tell me what License you will use?

My projects are interactive content creation like in this video https://youtu.be/o2Y-f_frc5c

So I would like to start just rendering the background without any geometry and then let the user add geometry interactively. Is this possible in OpitX7_Utility? If so, could you please tell me how to do it?

Thanks!

shocker-0x15 commented 4 years ago

Hi,

I'm so glad to hear that a person other than me want to use it. I haven't really expect such a thing happens, so I haven't prepared formal license descriptions yet. I'd like to use MIT license but it's enough to put credit me somewhere in any form for now. Let me prepare the license description soon.

I think it's possible to add/remove objects interactively and render them with OptiX utility:

  1. add/remove objects to GAS or IAS depending on your demand.
  2. call prepareForBuild() to get the required memory size (and scratch memory sizes) for the acceleration structure (AS).
    1. You need to reallocate memory/scratch memory if the sizes are larger than the current allocated memory.
  3. rebuild() the AS.
    1. If you build the AS on a different CUstream than the one used for rendering, you need to pay attention that renderer does not use the AS memory until build completes.
  4. Render a scene using the AS. (You can get its newly created handle from the return value of build() or getHandle() method.

When you add/remove a new GeometryInstance to GAS, it will invalidate shader binding table as well as marking the GAS dirty (meaning AS needs to be rebuilt). Therefore you also need to call Scene::generateShaderBindingTableLayout() to update shader binding table layout. This means then you need rebuild IAS because instances have offsets in the shader binding table. (See the OptiX official documentation for details.)

I don't think tests for many functions in the OptiX util are enough to be honest, and there should be many use cases I couldn't have considered. So I recommend you always keep in mind regarding raw OptiX behavior.

Thanks!

Hurleyworks commented 4 years ago

Thanks for the reply!

I think I understand how to interactively add and remove objects. But what I can't figure out is how to render a scene with no geometry .... so all rays are just handled by the Miss() program until the user adds some mesh.

Without geometry it seems impossible to create a valid SBT because the sbtSize will be 0

cudau::Buffer shaderBindingTable;
size_t sbtSize;
scene.generateShaderBindingTableLayout (&sbtSize);
 shaderBindingTable.initialize (cuContext, cudau::BufferType::Device, sbtSize, 1);
Hurleyworks commented 4 years ago

I found a way to render a scene with no geometry by creating a shaderBindingTable buffer for a single HitGroupSBTRecord. The only problem is that the HitGroupSBTRecord definition is not exposed to clients so I cannot get sizeof (HitGroupSBTRecord). This works just as I had hoped ...... all rays are just handled by the Miss() program

cudau::Buffer shaderBindingTable;
size_t sbtSize;
scene.generateShaderBindingTableLayout (&sbtSize);
if (sbtSize == 0)
        sbtSize = 48;  // sizeof (HitGroupSBTRecord) is private
 shaderBindingTable.initialize (cuContext, cudau::BufferType::Device, sbtSize, 1);

// render with no geometry
  Shared::PipelineLaunchParameters plp;
  plp.travHandle = 0;
  plp.geomInstData = nullptr;
  plp.geomPreTransforms = nullptr;
shocker-0x15 commented 4 years ago

No geometry is one of actual cases I haven't considered well, it is a corner case (There are many corners now :) ) I need to fix the issue you found. But for now, creating a dummy SBT seems a reasonable way.

Hurleyworks commented 4 years ago

Great!, Thanks for looking into this issue.!

shocker-0x15 commented 4 years ago

I added a new sample "scene edit" where the user can try to thoroughly add/remove geometry instances, GASs, instances, IASs in asynchronous fashion. I still need more work for GUI to edit scene and perhaps need to fix the utils.

BTW, I noticed OptiX 7.1 silently added a new device function optixGetSbtGASIndex(), so I removed sbtGasIndex from hit record. Additionally, now the hit record has a new member gasData by which we can identify GAS-local data.

shocker-0x15 commented 4 years ago

I'll close this issue once the new sample gets kind of decent.

Hurleyworks commented 4 years ago

Thanks very much for taking the time to make such a thorough example of scene editing. It is very helpful!

I found a small problem in loadObjFile(). OBJ files with no texcoords will crash. I'm including a simple test obj file.

I also noticed that in the CUDA c/c++ properties for optix_kernels.cu, the Device/Use fast math option is not set. I believe that the Optix devs on the Optix Forums have recommended using that option when compiling.

On Wed, Jul 29, 2020 at 7:59 AM shocker-0x15 notifications@github.com wrote:

I added a new sample "scene editing" where the user can try to thoroughly add/remove geometry instances, GASs, instances, IASs. I still need more work for GUI to edit scene and perhaps need to fix the utils.

BTW, I noticed OptiX 7.1 covertly added a new device function optixGetSbtGASIndex(), so I removed sbtGasIndex from hit record. Additionally, now the hit record has a new member gasData by which we can identify GAS-local data.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/shocker-0x15/OptiX7_Utility/issues/1#issuecomment-665621972, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB56PPYXOJGYA4XXEH4HR73R6AFLPANCNFSM4OZRLY6Q .

-- -Steve http://www.hurleyworks.com

Hurleyworks commented 4 years ago

Also the 02_scene_edit sample is crashing on exit.

On Wed, Jul 29, 2020 at 4:43 PM Hurleyworks stevehurley33@gmail.com wrote:

Thanks very much for taking the time to make such a thorough example of scene editing. It is very helpful!

I found a small problem in loadObjFile(). OBJ files with no texcoords will crash. I'm including a simple test obj file.

I also noticed that in the CUDA c/c++ properties for optix_kernels.cu, the Device/Use fast math option is not set. I believe that the Optix devs on the Optix Forums have recommended using that option when compiling.

On Wed, Jul 29, 2020 at 7:59 AM shocker-0x15 notifications@github.com wrote:

I added a new sample "scene editing" where the user can try to thoroughly add/remove geometry instances, GASs, instances, IASs. I still need more work for GUI to edit scene and perhaps need to fix the utils.

BTW, I noticed OptiX 7.1 covertly added a new device function optixGetSbtGASIndex(), so I removed sbtGasIndex from hit record. Additionally, now the hit record has a new member gasData by which we can identify GAS-local data.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/shocker-0x15/OptiX7_Utility/issues/1#issuecomment-665621972, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB56PPYXOJGYA4XXEH4HR73R6AFLPANCNFSM4OZRLY6Q .

-- -Steve http://www.hurleyworks.com

-- -Steve http://www.hurleyworks.com

shocker-0x15 commented 4 years ago

Thanks for the bug report. I fixed the crash on exit and replaced tiny_obj_loader with assimp (dynamic linked), added no-texcoord model handling.

I already specified fast math option in project-level settings. You can see for example that sin.approx.ftz.f32 is used in the ptx.

shocker-0x15 commented 4 years ago

Oh, I noticed "Use Fast Math" option explicitly exists in the setting list in CUDA C/C++ (is this since CUDA 11? :) I'll replace "additional option" in command line by this.

Thanks.

shocker-0x15 commented 4 years ago

Weird. "Use Fast Math" option seems not to have effect for ptx generation. (I'm not sure about CUDA/C++ fused code with CUDA runtime API). I added --use_fast_math as "additional options" again.

Hurleyworks commented 4 years ago

Thanks for the quick fixes. I confirm that OBJ file with no texture coords load without crashing and the use_fast_math option is set in the project.

In OptiX 7.1, support for using NVRTC has returned. The OptiX7.1.1 SDK Samples use it now and I would prefer to use it in my own projects but there are many compiler errors when I try to use it with OptiX7_Utility. I believe the errors are because cuda_utilty.h includes cuda.h and cuda.h includes stdlib.h. Is it possible to make OptiX7_Utility work with NVRTC? Examples of how to set it up are in OptiX7 Samples/sutil.h and sampleConfig.h.

On Thu, Jul 30, 2020 at 2:59 PM shocker-0x15 notifications@github.com wrote:

Weird. "Use Fast Math" option seems not to have effect for ptx generation. (I'm not sure about CUDA/C++ fused code with CUDA runtime API). I added --use_fast_math as "additional options" again.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/shocker-0x15/OptiX7_Utility/issues/1#issuecomment-666603451, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB56PP33NUJI724CGA7ZPGDR6G7JHANCNFSM4OZRLY6Q .

-- -Steve http://www.hurleyworks.com

Hurleyworks commented 4 years ago

I made some progress!! Amazingly it only took a few extra lines of code to get geometry instances working. Thanks again for making such a well designed and easy to use api!

https://youtu.be/Tky1Pvt1pLs

On Thu, Jul 30, 2020 at 3:53 PM Hurleyworks stevehurley33@gmail.com wrote:

Thanks for the quick fixes. I confirm that OBJ file with no texture coords load without crashing and the use_fast_math option is set in the project.

In OptiX 7.1, support for using NVRTC has returned. The OptiX7.1.1 SDK Samples use it now and I would prefer to use it in my own projects but there are many compiler errors when I try to use it with OptiX7_Utility. I believe the errors are because cuda_utilty.h includes cuda.h and cuda.h includes stdlib.h. Is it possible to make OptiX7_Utility work with NVRTC? Examples of how to set it up are in OptiX7 Samples/sutil.h and sampleConfig.h.

On Thu, Jul 30, 2020 at 2:59 PM shocker-0x15 notifications@github.com wrote:

Weird. "Use Fast Math" option seems not to have effect for ptx generation. (I'm not sure about CUDA/C++ fused code with CUDA runtime API). I added --use_fast_math as "additional options" again.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/shocker-0x15/OptiX7_Utility/issues/1#issuecomment-666603451, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB56PP33NUJI724CGA7ZPGDR6G7JHANCNFSM4OZRLY6Q .

-- -Steve http://www.hurleyworks.com

-- -Steve http://www.hurleyworks.com

shocker-0x15 commented 4 years ago

It's great! Your project helps making this project robust thank you from me too.

I'm investigating NVRTC consideration. I tried to exclude #include cstdint, cfloat, cuda.h at the top of cuda_util.h like the following:

#if !defined(__CUDACC_RTC__)
#include <cstdint>
#include <cfloat>
#include <cuda.h>
#endif

and tried to compile like this:

const char* rtcSource =
    R"(
#include <cuda/std/cstdint>
#include <cuda/std/cfloat>
#include <optix_util.h>

RT_CALLABLE_PROGRAM float3 RT_DC_NAME(rtcDCProgram)(uint32_t texID, float2 texCoord) {
float2 rTexCoord = make_float2(texCoord.x - floor(texCoord.x),
                            texCoord.y - floor(texCoord.y));
bool b = (rTexCoord.x > 0.5f) ^ (rTexCoord.y > 0.5f);
float value = b ? 0.0f : 0.5f;
return make_float3(value, value, value);
}
)";

nvrtcProgram rtcProgram;
nvrtcResult rtcResult;

NVRTC_CHECK(nvrtcCreateProgram(&rtcProgram, rtcSource, "rtcSource.cu", 0, nullptr, nullptr));

const char* options[] = {
    "-std=c++17",
    "-arch", "compute_52",
    "-use_fast_math",
    "-lineinfo",
    "-rdc", "true",
    "-IC:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.0\\include",
    "-IC:\\ProgramData\\NVIDIA Corporation\\OptiX SDK 7.1.0\\include",
    "-IC:\\Users\\shocker_0x15\\Documents\\repos\\OptiX_Utility",
    "-default-device",
};

size_t rtcLogSize;
rtcResult = nvrtcCompileProgram(rtcProgram, lengthof(options), options);
NVRTC_CHECK(nvrtcGetProgramLogSize(rtcProgram, &rtcLogSize));
char* rtcLog = new char[rtcLogSize];
NVRTC_CHECK(nvrtcGetProgramLog(rtcProgram, rtcLog));
hpprintf("%s\n", rtcLog);
delete[] rtcLog;
if (rtcResult != NVRTC_SUCCESS) {
    hpprintf("Failed to compile a program.\n");
}

This was almost success to compile CUDA code with OptiX utility, but NVRTC complains error: identifier "CUsurfObject" is undefined.

So I need to find a way to bring CUDA built-in type definitions to NVRTC world. Additionally I prefer to use math functions with std namespace. This seems possible by using files under cuda/std directory but not tested yet.

shocker-0x15 commented 4 years ago

Ignoring cuda_util.h entirely is possibly another way. But I'd like to search a way with this header because I think it's good to be able to write code without caring about whether it's NVRTC or not.

shocker-0x15 commented 4 years ago

I updated CUDA/OptiX utils with minimum changes.

Now we can compile CUDA source with cuda_util.h (currently this defines just only some macros) like:

#include <cuda/std/cstdint>
#include <cuda/std/cfloat>
#include <cuda_util.h>

CUDA_DEVICE_KERNEL void rtcKernel(cudaTextureObject_t texture, uint32_t lodLevel, int2 imageSize,
                                  cudaSurfaceObject_t outputBuffer) {
    int2 launchIndex = make_int2(blockDim.x * blockIdx.x + threadIdx.x,
                                 blockDim.y * blockIdx.y + threadIdx.y);
    float2 texCoord = make_float2(static_cast<float>(launchIndex.x) / imageSize.x,
                                  static_cast<float>(launchIndex.y) / imageSize.y);
    float4 texValue = tex2DLod<float4>(texture, texCoord.x, texCoord.y, lodLevel);
    surf2Dwrite(texValue, outputBuffer, launchIndex.x * sizeof(texValue), launchIndex.y,
                cudaBoundaryModeTrap);
}

and we can compile OpitX source with optix_util.h like:

#include <cuda/std/cstdint>
#include <cuda/std/cfloat>
#include <optix_util.h>

RT_CALLABLE_PROGRAM float3 RT_DC_NAME(rtcDCProgram)(uint32_t texID, float2 texCoord) {
    float2 rTexCoord = make_float2(texCoord.x - floor(texCoord.x),
                                   texCoord.y - floor(texCoord.y));
    bool b = (rTexCoord.x > 0.5f) ^ (rTexCoord.y > 0.5f);
    float value = b ? 0.0f : 0.5f;
    return make_float3(value, value, value);
}

CUDA_DEVICE_KERNEL void RT_IS_NAME(custom_primitive)() {
    auto sbtr = optixu::getHitGroupSBTRecordData();
    uint32_t primIndex = optixGetPrimitiveIndex();
    const float3 rayOrg = optixGetObjectRayOrigin();
    const float3 rayDir = optixGetObjectRayDirection();

    float3 someValue = make_float3(rayOrg.x + optixGetRayTmax() * rayDir.x,
                                   rayOrg.y + optixGetRayTmax() * rayDir.y,
                                   rayOrg.z + optixGetRayTmax() * rayDir.z);
    float t = 0.0f;
    if (someValue.x + someValue.y + someValue.z < 0.5f)
        t = 1.0f;

    optixu::reportIntersection(t, 0, someValue.x, someValue.y, someValue.z);
}
Hurleyworks commented 4 years ago

The sample code above compiles now in your latest update today but the scene_edit example's optix_kernels.cu will not work because including common.h generates some more compiler errors

The first error is std contains no sqrt function and I could fix it with

CUDA_DEVICE_FUNCTION float length(const float3 &v) {

#if !defined(__CUDACC_RTC__)
return std::sqrt(v.x * v.x + v.y * v.y + v.z * v.z);
#else
return sqrt ((float)(v.x * v.x + v.y * v.y + v.z * v.z));
#endif

}

The next errors are more deadly. The Matrix3x3 struct won't compile because apparently NVRTC does not support anonymous unions https://github.com/NVlabs/cub/issues/87

I made a simple struct called TESTER that generates these errors 0.435438 DEBUG [3136 NVRTCompiler.h->compileWithNVRTC:68] D:\ActiveWorks\Code\ActiveBerserko\thirdparty\optiX7Util\src\common.h(529): warning: declaration does not declare anything D:\ActiveWorks\Code\ActiveBerserko\thirdparty\optiX7Util\src\common.h(530): warning: types cannot be declared in anonymous unions D:\ActiveWorks\Code\ActiveBerserko\thirdparty\optiX7Util\src\common.h(538): error: identifier "m00" is undefined D:\ActiveWorks\Code\ActiveBerserko\thirdparty\optiX7Util\src\common.h(538): error: identifier "m10" is undefined D:\ActiveWorks\Code\ActiveBerserko\thirdparty\optiX7Util\src\common.h(538): error: identifier "m20" is undefined

struct TESTER

{ union { struct { float m00, m10, m20; }; float3 c0; }; CUDA_DEVICE_FUNCTION float3 row (unsigned int r) const { return make_float3 (m00, m10, m20); } };

If this is going to be too much work for you to fix, no worries for me. Being able to use NVRTC is just a convenience for me, not a necessity.

On Fri, Jul 31, 2020 at 3:52 PM shocker-0x15 notifications@github.com wrote:

Ignoring cuda_util.h entirely is possibly another way. But I'd like to search a way with this header because I think it's good to be able to write code without caring about whether it's NVRTC or not.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/shocker-0x15/OptiX7_Utility/issues/1#issuecomment-667322809, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB56PP7IHLP7G25G3LHUPSTR6MOJBANCNFSM4OZRLY6Q .

-- -Steve http://www.hurleyworks.com

shocker-0x15 commented 4 years ago

I understand. I can do nothing for the problems like the non-support of anonymous union, so I leave from more NVRTC work for now. I’m currently working to support motion transform and multi-level instancing to make the utility close to feature complete.

Thanks

Hurleyworks commented 4 years ago

Is there a way to support different materials for geometric instancing. I'd like to give each instance at least a different albedo. It doesn't seem possible since each instance uses the same GeometryGroup.

instanced_fish

Hurleyworks commented 4 years ago

One more feature I'd like to see if you have time is support for mouse Pick Ray. My apps need it for user object selection and painting. There's a discussion on how to do it on the OptiX forum

https://forums.developer.nvidia.com/t/pick-ray-in-optix7/82321

Hurleyworks commented 4 years ago

One last question and then I'll leave you alone.:)

My gui runs on the main thread and so I run Optix and the physics engine on separates threads so that long running calculations do not effect gui responsiveness. Because of this I do not use CUDA_UTIL_USE_GL_INTEROP in my projects. I use the HostBlockBuffer2D for the render buffer. I'd like to do a direct memcpy into my own buffer that I send to Opengl but the only way I see to get the pixel data is by iterating through each pixel which is a little slower. Is there a way to copy the whole buffer at once?

accumBuffer.map();

    sabi::PixelBuffer& pixels = camera->getPixelBuffer();
    int i = 0;
    for (int y = 0; y < renderTargetSizeY; ++y)
    {
        for (int x = 0; x < renderTargetSizeX; ++x)
        {
            const float4& p = accumBuffer (x, y);
            pixels.floatPixels.col (i++) = Eigen::Vector4f (p.x, p.y, p.z, p.w);
        }
    }

    accumBuffer.unmap();
shocker-0x15 commented 4 years ago

Is there a way to support different materials for geometric instancing.

Each GeometryInstance can set a material with two indices, matSetIdx and matIdx, so you can set multiple materials with the same matIdx. Then you create a GAS from the GeomInst and set the number of material sets with setNumMaterialSets(). After that you can create multiple instances with the same GAS but with different material set by specifying the second argument of Instance::setGAS().

But perhaps it is better NOT to use this feature because different material might lead to execution divergence on GPU. So in this case, alternative solution is using a single material (== single hit group) and read different albedo values using instance index (optixGetInstanceIndex() or optixGetInstanceId()).

shocker-0x15 commented 4 years ago

Regarding mouse picking, while this is the feature everyone wants, but this seems too much for this library scope. Another issue is camera model, there is no reason that everyone uses perspective camera model in ray tracing world and I have no knowledge about what camera model people uses with this utility. So leaving the user to implement such a feature seems reasonable.

For the final question you post, let me check it tomorrow :)

Thanks,

shocker-0x15 commented 4 years ago

(Implementing mouse picking as a sample code is doable.)

shocker-0x15 commented 4 years ago

For optixGetInstanceId(), the current Instance class doesn't expose the user to set the value, I need to extend.

shocker-0x15 commented 4 years ago

Regarding HostBlockBuffer2D, as you may already know it is a tiled buffer to improve cache coherency (but I haven't tested its effectiveness, it is a general theory PBRT Blocked 2D Arrays). So it is impossible to copy it in one operation unless your buffer has completely the same layout.

Therefore, you might be better to use a linear buffer like cudau::TypedBuffer and manually computing 2D to 1D index mapping.

BTW, I wrote that geometry instancing with different material by using material set is not recommended due to execution divergence, please forget this. I guess that if all the hit groups are the same among materials, there is no execution divergence. (Not 100% confident).

Hurleyworks commented 4 years ago

(Implementing mouse picking as a sample code is doable.)

Hey, you're right. I have it working now. Sorry, I don't know why I thought it had to be implemented in library code.

On Tue, Aug 4, 2020 at 5:02 PM shocker-0x15 notifications@github.com wrote:

(Implementing mouse picking as a sample code is doable.)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/shocker-0x15/OptiX7_Utility/issues/1#issuecomment-668823456, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB56PP6KPY7QKU3WOLLE5MLR7BZMXANCNFSM4OZRLY6Q .

-- -Steve http://www.hurleyworks.com

shocker-0x15 commented 4 years ago

BTW, I finished to implement motion transform and multi-level instancing (not thoroughly tested yet) and added a new sample. Due to this, Instance::setGAS() has been changed to Instance::setChild().

Hurleyworks commented 4 years ago

Sorry, for the delay. Your comments are now ending up in my spam folder for some reason.

So it is impossible to copy it in one operation unless your buffer has

completely the same layout.

Yes, I discovered that when I tried copying the raw_buffer :)

Thanks for the help with different materials with geometry instances. I'll give it a try. The multi_level_instancing sample is very cool! I'm trying to get motion blur working in my project now.

BTW, I keep forgetting to tell you that the scene_edit sample will not run out of the box here because it's looking for non-existent font in the executable directory. I had to download the font from the internet to make it work.

std::filesystem::path fontPath = exeDir /

"fonts/RictyDiminished-Regular.ttf"; ImFont* fontForFileDialog = io.Fonts->AddFontFromFileTTF(fontPath.u8string().c_str(), 14.0f, nullptr,

io.Fonts->GetGlyphRangesJapanese());

On Wed, Aug 5, 2020 at 12:31 PM shocker-0x15 notifications@github.com wrote:

Regarding HostBlockBuffer2D, as you may already know it is a tiled buffer to improve cache coherency (but I haven't tested its effectiveness, it is a general theory PBRT Blocked 2D Arrays http://www.pbr-book.org/3ed-2018/Utilities/Memory_Management.html). So it is impossible to copy it in one operation unless your buffer has completely the same layout.

Therefore, you might be better to use a linear buffer like cudau::TypedBuffer and manually computing 2D to 1D index mapping.

BTW, I wrote that geometry instancing with different material by using material set is not recommended due to execution divergence, please forget this. I guess that if all the hit groups are the same among materials, there is no execution divergence. (Not 100% confident).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/shocker-0x15/OptiX7_Utility/issues/1#issuecomment-669297459, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB56PP2SHH3NAP3RMZAIFO3R7GCOVANCNFSM4OZRLY6Q .

-- -Steve http://www.hurleyworks.com

shocker-0x15 commented 4 years ago

the scene_edit sample will not run out of the box here because it's looking for non-existent font

Thanks, I fixed it to run without the font while it shows a warning message. This is the font for Japanese, so you maybe don't need it.

shocker-0x15 commented 4 years ago

I rewrote the GUI using ImGui's tree + table as well as added the feature to edit pre-transforms of each GeometryInstance belonging to some GAS. I think now it gets easier to edit than before.

It is probably still buggy when continuing editing, but I think it gets decent feature complete as scene edit sample. I'll close this issue.

Hurleyworks commented 4 years ago

Thanks. And thanks again for taking the time to make such a thorough example for scene editing. This has been very helpful for me!

I found a little cut and paste error in the 03.multi_level_instancing sample. Looks like lines 486 - 488 in multi_level_instancing_main.cpp are from the single_level_instancing sample and are not used here.

constexpr uint32_t NumBunnies = 100;const float GoldenRatio = (1 + std::sqrt(5.0f)) / 2; const float GoldenAngle = 2 M_PI / (GoldenRatio GoldenRatio);

One problem I hit while trying to get Motion Blur working in my own project was that I forgot to set the "useMotionBlur" to true in the Pipeline::setPipelineOptions(); This causes Optix to throw a bunch of "error: invalid traversable" exceptions which mislead me to think there were other problems in my code and I spent a lot of time trying to figure out what was wrong. . You've done a great job checking for user errors in a lot of the optix_util classes. If it's possible, maybe you could warn users if they have other motion blur options set but do not have the "useMotionBlur" options set in the pipeline options.

On Wed, Aug 12, 2020 at 9:46 AM shocker-0x15 notifications@github.com wrote:

I rewrote the GUI using ImGui's tree + table as well as added the feature to edit pre-transforms of each GeometryInstance belonging to some GAS. I think now it gets easier to edit than before.

It is probably still buggy when continuing editing, but I think it gets decent feature complete as scene edit sample. I'll close this issue.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/shocker-0x15/OptiX7_Utility/issues/1#issuecomment-672880527, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB56PP6VGFCTHBXIFXMI2O3SAKMLVANCNFSM4OZRLY6Q .

-- -Steve http://www.hurleyworks.com

shocker-0x15 commented 4 years ago

Thanks for quick trying and nice catch for lack of motion blur checking. I'll consider where I should put checking&warning code.

shocker-0x15 commented 4 years ago

I'm closing this issue. If you find something more, please create a new issue.

Thanks!