Git Product home page Git Product logo

gfxexp's Introduction

Hi there ๐Ÿ‘‹

shocker's GitHub stats

gfxexp's People

Contributors

shocker-0x15 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gfxexp's Issues

Q: Passing texture objects

Is it possible to pass Texture objects to CUDA kernels
or are only Buffers (typed and untyped) supported?

How to set the correct commond line parameters?

For the neural radiance caching example, the paths of the mesh and texture are required in the No.808 line of "neural_radiance_caching_main.cpp" with function "parseCommandline(argc, argv);". However, I failed several times in giving the file path by command line parameters.
Can you give an example of the command line parameters? like "-inst /ZeroDay_v1/MEASURE_ONE/MEASURE_ONE.fbx"

DynamicFunction

What does DynamicFunction class do? Is it an equivalent to a function pointer on a device?

I am interested in using this abstraction (function pointer) for one of my projects.
Is there a simple example of how it's used in a kernel?

Thanks!

Getting some NaN in path_tracing sample

I'm getting some NaN in optix_pathtracing_kernels.cu line 201
RGB colorResult = (1 - curWeight) * prevColorResult + curWeight * contribution;

I add these lines after line 201 to color the NaN pixels super red

 RGB colorResult = (1 - curWeight) * prevColorResult + curWeight * contribution;
 if (isnan(colorResult.r) || isnan(colorResult.g) || isnan(colorResult.b))
 {
     printf("contribution: %f, %f, %f\n", contribution.r, contribution.g, contribution.b);
     colorResult = RGB(make_float3(1000000.0f, 0.0f, 0.0f)); // super red
 }

And here is the output after rendering for a few minutes. Do you know what the problem might be? It is still so hard to debug OptiX. It seems it gets harder and harder with each new release.

nan

bug in createGeometryInstance()

Howdy,

Thanks for making these interesting experiments available! Will you be making a license file for this project?

I think I found a bug in createGeometryInstance() starting on line 1599 of common_host.cpp where the aabb is being created.

for (int triIdx = 0; triIdx < triangles.size(); ++triIdx) {
        const shared::Triangle &tri = triangles[triIdx];
        const shared::Vertex (&vs)[3] = {
            vertices[tri.index0],
            vertices[tri.index1],
            vertices[tri.index2],
        };
        geomInst->aabb
            .unify(vertices[0].position)
            .unify(vertices[1].position)
            .unify(vertices[2].position);
    }

I think the correct code should be:

geomInst->aabb
            .unify(vs[0].position)
            .unify(vs[1].position)
            .unify(vs[2].position)

Out of bounds bug in Matrix4x4_T constructor

LIne 2922 of basic_types.h

passed in array size is too small. Should be 16

CUDA_COMMON_FUNCTION CUDA_INLINE constexpr Matrix4x4_T(const F array[9]) :
    m00(array[0]), m10(array[1]), m20(array[2]), m30(array[3]),
    m01(array[4]), m11(array[5]), m21(array[6]), m31(array[7]),
    m02(array[8]), m12(array[9]), m22(array[10]), m32(array[11]),
    m03(array[12]), m13(array[13]), m23(array[14]), m33(array[15]) { }

TFDM sample - slow render times

Hi there,

I just built the TFDM sample you've showcased on Twitter: https://twitter.com/Shocker_0x15/status/1725546495423001032?s=20

And for some reason my render time is a lot slower compared to yours. I have tested both RTX 4090 and RTX 3090, with 180ms and 250ms render times, respectively.

CUDA_perf

NVIDIA Driver: 546.17
RTX 4090 & 3090 GPUs
Windows 11 23H2
Visual Studio Community 17.7.6
OptiX 8.0.0
CUDA 12.3.1 toolkit

Thanks for sharing this excellent work.

Crash in path_tracing project in debug mode only

Hi,

I'm getting a consistent crash in all scenes I try using the path_tracing project in Debug mode only. Release mode works fine. The error message that appears using Nsight->CUDA Debugging is [Error 700: Illegal address during kernel execution].

And the debugger usually stops at this line

CUDA_DEVICE_KERNEL void RT_CH_NAME(pathTraceBaseline)() {
    pathTrace_closestHit_generic();
}

OptiX 7.40 / CUDA 11.7
Driver: 516.59
Visual Studio 2022 17.2.4
Windows 10
RTX 2070 SUPER

Can you confirm this using your environment? I wonder if it has anything to do with this thread.
https://forums.developer.nvidia.com/t/illegal-address-error-when-using-both-geometrytriangles-and-geometry-nodes/218956/18

Run-time NRC crash: cuGraphicsGLRegisterImage()

The VS solution compiles just fine, but when I run neural_radiance_cache.exe with the correct parameters, I get the following error:
Error: CUDA call (cuGraphicsGLRegisterImage(&m_cudaGfxResource, glTexID, GL_TEXTURE_2D, flags) ) failed with error: 'OS call failed or operation not supported on this OS' (...\GfxExp\utils\cuda_util.cpp:677)

As a note, the program is able to identify my RTX 3060 card.

Question about light contribution calculation

Hi,

contribution += emittance / Pi;

contribution += emittance / Pi;

I noticed that emittance is divided by PI even when the primary hit of the ray was an emitter. I was wondering what the reason is for this? For example if a primary ray hits an emitter with emittance (1.0, 1.0, 1.0) the shading will result in (1/pi, 1/pi, 1/pi) resulting in a visually dimmed primitive on the screen. Naturally this is only noticeable with emitters with emitting strength lower than pi.

image
Here I am hovering a pixel for which the primary hit is an emitter with values (1.0, 1.0, 1.0) as you can see in the debug info. I think the pixel in that case should also have value (1.0, 1.0 ,1.0) unless I understand wrong.

This is the result when using contribution += emittance;
image

m_isInitialized flag is not reset to false after RegularConstantContinuousDistribution1DTemplate::finalize() and RegularConstantContinuousDistribution2DTemplate::finalize()

My project allows user to interactively change HDR environment image so I need to initialize and finalize the
RegularConstantContinuousDistribution2D envLightImportanceMap each time a new environment hdr is selected. Currently the finalize() functions do not reset the m_isInitialized flag to false, so I hit this assert when I try to initialize the envLightImportanceMap a second time.

 // Assert that we're not already initialized
 Assert (!m_isInitialized, "Already initialized!");

Question about Neural Radiance Cache

Thanks for your implementation of this algorithm!

Beginner's question: I am trying to understand the training part of the NRC algorithm.
I have read the paper several times and it's still not clear to me.

Say, you have a path x0 x1 x2 (x0 - camera, x1 - surface, x2 - surface). How do you train the cache?

  1. Do you explicitly sample lights at each intermediate vertex, to get paths x0 x1 l2 (where l2 is now vertex on a light source) and x0 x1 x2 l3 and then put end vertices (in this case x1, and x2) and direction (x2 -> x1, and x1 -> x0) into cache?
  2. How does the "path extension" work?
  3. There was an issue with "flickering" that was solved by temporal smoothing. How do you solve this problem?

NRC Only Results (Directly Visualized Prediction) Appear Much Darker Than the Paper Suggested?

Hi there, thank you so much for your great work!

I have a question when looking into the implementation of NRC, specifically, the immediate prediction of NRC network obtained via the "directly visualized prediction" option seems to result in a much darker rendering compared to the path tracing/path tracing + NRC. For example, below is the result of path tracing + NRC:
00900

And the result of NRC only:
00900

While according to the figure 4 of the original paper, visualizing NRC output at first vertex would give frequency artifacts in early frames (seems to be resolved with hash grid encoding tho), but the overall brightness should be the same:
image

When looking into the details of the implementation, I realized that the path tracing + NRC result is obtained by summing the direct light sampling through the next event estimation with the predicted radiance of NRC. However, the training target of NRC seems to already include both (direct contribution + indirect contribution from next NRC output). I'm quite confused by this, because if my understanding is correct, then it would be unnecessary to sum direct light sampling contribution to the rendering again and the NRC output should be much brighter. May I ask if you could provide any insight on this? Any comments would be much appreciated!

Many thanks.

Materials do not re-use textures leading to duplicate textures in memory.

Hi,

When using a scene such as lost-empire I get the following error : Error: CUDA call (cuArray3DCreate(&m_array, &arrayDesc) ) failed with error: 'out of memory' (C:\Users\X\Documents\Shocker\GfxExp\utils\cuda_util.cpp:693). I think what is happening is that for every material in the mtl file the map_Ka and map_Kd attributes are loaded into memory even if those same textures have been loaded into memory already for another material. This is confirmed by the console output:


[ 4][  DISK CACHE]: Opened database: "C:\Users\X\AppData\Local\NVIDIA\OptixCache\optix7cache.db"
[ 4][  DISK CACHE]:     Cache data size: "1.8 MiB"
[ 4][   DISKCACHE]: Cache hit for key: ptx-538030-keyf4770f7ee17acca7955c0792d6c5b076-sm_61-rtc0-drv496.76
[ 4][COMPILE FEEDBACK]:
[ 4][   DISKCACHE]: Cache hit for key: ptx-40534-keyf6edc5a05105d08ef92e4c8cff25c7c6-sm_61-rtc0-drv496.76
[ 4][COMPILE FEEDBACK]:
[ 4][COMPILE FEEDBACK]: Info: Pipeline has 1 module(s), 35 entry function(s), 32 trace call(s), 0 continuation callable call(s), 54 direct callable call(s), 707 basic block(s) in entry functions, 19309 instruction(s) in entry functions, 0 non-entry function(s), 0 basic block(s) in non-entry functions, 0 instruction(s) in non-entry functions

Reading: ../scenes/lost-empire/lost_empire.obj ... done.
DefaultMaterial:
Stone:
  Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Grass_Block:
  Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Dirt:
  Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Cobblestone:
  Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Oak_Planks:
  Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Stationary_Water:
  Reading: ../scenes/lost-empire/lost_empire-RGBA.png ... done.
Stationary_Lava:
  Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
  Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Sand:
  Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Gravel:
  Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Iron_Ore:
  Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Coal_Ore:
  Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Oak_Log:
  Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Oak_Leaves:
  Reading: ../scenes/lost-empire/lost_empire-RGBA.png ... done.
Bed:
  Reading: ../scenes/lost-empire/lost_empire-RGBA.png ... done.
Powered_Rail:
  Reading: ../scenes/lost-empire/lost_empire-RGBA.png ... done.
Detector_Rail:
  Reading: ../scenes/lost-empire/lost_empire-RGBA.png ... done.
Sticky_Piston:
  Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Wool:
  Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Dandelion:
  Reading: ../scenes/lost-empire/lost_empire-RGBA.png ... done.
Poppy:
  Reading: ../scenes/lost-empire/lost_empire-RGBA.png ... done.
Brown_Mushroom:
  Reading: ../scenes/lost-empire/lost_empire-RGBA.png ... done.
Double_Stone_Slab:
  Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Stone_Slab:
  Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Obsidian:
  Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Torch:
  Reading: ../scenes/lost-empire/lost_empire-RGBA.png ... done.
  Reading: ../scenes/lost-empire/lost_empire-RGBA.png ... done.
Oak_Stairs:
  Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Chest:
  Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Redstone_Wire:
  Reading: ../scenes/lost-empire/lost_empire-RGBA.png ... Error: CUDA call (cuArray3DCreate(&m_array, &arrayDesc) ) failed with error: 'out of memory' (C:\Users\X\Documents\Shocker\GfxExp\utils\cuda_util.cpp:693)

As you can see the same textures are loaded over and over.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.