Hi everybody, I am working on a project that involves both rasterization and computation. Right now I have a shader that contains this declaration:
layout (location = 0) out vec4 FragColor;
layout (binding = 0) uniform sampler3D VolumeTexture[MIPLEVELS];
uniform mat4 ModelViewProjectionInverse;
uniform float VolumeDim;
and I was wondering what would these elements correspond into an openCL kernel. Do I need to perform any conversion or can I just use them in the same way I do in the shader:
vec4 world0 = Scale * ModelViewProjectionInverse * ndc0;
...
vec4 color = texture(VolumeTexture[currentLevel], texCoords);
FragColor = color;
I initialise them in this way:
glUseProgram(volumeRenderShader.ProgramId());
glUniform1i(glGetUniformLocation(volumeRenderShader.ProgramId(), "VolumeTexture"), 0);
glUniformMatrix4fv(glGetUniformLocation(volumeRenderShader.ProgramId(), "ModelViewProjectionInverse"), 1, GL_TRUE, glm::value_ptr(glmTrans));
glUniform1f(glGetUniformLocation(volumeRenderShader.ProgramId(), "VolumeDim"), volumeDimensions);
...
for (int i = 0; i < MIPLEVELS; ++i){
glActiveTexture(GL_TEXTURE0 + i);
glBindTexture(GL_TEXTURE_3D, volumeTexture[i]);
}