The optix7.0 program references the sutil.cpp file, the optix7.0 program will not change after sutil.cpp is changed

I use win10, optix7.0, vs2019 configuration。

I created a new program, copied the code of optixwhitted and referenced sutil_7_sdk.

I want to change the text color of the information displayed on the interface when the display is running, such as fps, render _time,display_time information.

For example, I want to change the gray text in the upper left corner of the picture below to red

I found that changing this color is in the displayText function in sutil.cpp.

I changed the text color in this function to red, but the text color when my program runs is still the default gray.

Below are my two programs, one is my main program Optixwhitted.cpp, and the other is the program sutil.cpp referenced by the main program.
optixWhitted.cpp (44.0 KB) sutil.cpp (34.0 KB)

Running a diff of your two files against OptiX SDK 7.0, 7.1, and 7.2 shows that these two files are from the OptiX SDK 7.1.0 and you just added a string in sutil.cpp and formatted the optixWhitted.cpp.

There is no color change done in those two files.
You say you’re using OptiX SDK 7.0. Did you change the wrong file maybe?

Looking at the sutil.cpp code, I don’t see why it shouldn’t work to change the displayText() function in line 740 to another color instead of the hardcoded 0.7 grey value:
ImGui::TextColored( ImColor( 0.7f, 0.7f, 0.7f, 1.0f ), "%s", text );

Thank you for your reply.

My program is the referenced sutil_7_sdk file, and my program uses the sutil.cpp program in this file for text information.

I used to change the color value to red in this sutil.cpp program

As follows


But at runtime, the text is still grayed out.

But when I also changed the sutil.cpp of the official demo, the color of the official Optixwhitted text information changed to red.

That sounds more as if you’re having different versions of the sutil code and the built dynamic link library sutil.dll of that.
Means you either changed the wrong code or you’re using the wrong sutil.dll without your changes in it.

Search for that sutil.dll file and sort by date. Then rebuild your solution and check which sutil.dll changed. Then check if that’s the one you copied next to your application’s executable.

I am optix beginner, would you help me out that
why Optixwhitted no noise , but optixRaycasting has Noise ?

First of all, optixRaycasting shouldn’t have noise because all that does is rendering a single image where the color of the hit surface is taken from the current shading normal as can be seen inside the shadeHitsKernel function.

You mean optixWhitted vs. optixPathTracer?

That is because these two examples are using a different light transport algorithm.

Whitted renderers are usually rendering a final image, but not integrating the rendering equation fully. It’s usually not a global illumination renderer. Lighting, soft shadows, glossy reflections, etc. won’t happen correctly with these.

A path tracer follows many ray paths through the scene by bouncing off hit surfaces normally into one continuation direction to integrate the rendering equation as best as possible.
Since there are an infinite amount of paths which could be followed this way, these are implemented as “Monte Carlo” algorithms which are drawing random numbers. Means an integral (here the rendering equation) is approximated by shooting many different ray paths.

This usually happens in a progressive rendering algorithm where each sub-frame follows (“traces”) a different ray path through the scene. The more sub-frames you accumulate, the nearer you get to the final converged result (the value of the integral you’re solving).
Each individual sub-frame has a high-frequency noise (variance) characteristic for such progressive Monte Carlo algorithms.

Different methods have been developed to reduce the variance in path tracers. Most importantly direct lighting (next event estimation), importance sampling (shoot rays according to the material’s or light’s distribution functions, where they are more important), multiple-importance sampling (considering the importance of the material distribution function vs. light’s distribution function), low-discrepancy samplers (“better” random number generators), and a lot more.

There are also different variants of path tracers and other light transport algorithms.

And here start your studies:

Come back if you have specific questions about OptiX.