Description
Hi,
I noticed that in Qt6 it has no effect to change the light source intensity. Then I started digging in the Qt3D source code, and in
src/plugins/renderers/opengl/renderer/renderview.cpp line 1399 in the
RenderView::updateLightUniforms() function, the light type is hardcoded to PointLight, the color is hardcoded to white and intensity is 0.5. Only the light position is updated, and the direction is not set at all. This means that it is not possible to use QDirectionalLight or QSpotLight in user code.
setUniformValue(command->m_parameterPack, GLLights::LIGHT_POSITION_NAMES[lightIdx], worldPos);
setUniformValue(command->m_parameterPack, GLLights::LIGHT_TYPE_NAMES[lightIdx], int(QAbstractLight::PointLight));
setUniformValue(command->m_parameterPack, GLLights::LIGHT_COLOR_NAMES[lightIdx], Vector3D(1.0f, 1.0f, 1.0f));
setUniformValue(command->m_parameterPack, GLLights::LIGHT_INTENSITY_NAMES[lightIdx], 0.5f);
Why is this?