In the OptiX shader, the results differ depending on whether "if" is used or not

Hi.

I am creating a certain simulation in OptiX.
The closest hit has this process

float a = /*float value*/;

If I do the following, the output array will be different even if it is “if(1)”.

float a = 0.0f;

if(1){
    a = /*float value*/;
}

The output is binary, so I cannot check the details, but the value of “a” is not different, and the same difference occurs no matter which variable is passed through “if(1)”.

I am using OptiX 7.1. Is this a bug? Is it a specification?

Oh… It was my mistake.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.