Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
qgsmesh3dmaterial: Ensure to create valid textures for the fragment s…
…hader In the shader code, all the parameters need to be properly initialized even if they are not used. Otherwise, this can create undefined behaviors and some missing meshes in a 3d scene. In the current code, there are two parameters which may not be properly initialized: - "colorRampTexture" is not set if the color ramp mode is not set - "arrowsGridTexture" texture image is invalid if the "display arrows" mode is disabled The first issue ("colorRampTexture") is solved by creating a dummy valid texture image if the color ramp mode is disabled and setting the "colorRampTexture" parameter in all cases. This does not change anything in the shader code. The parameter is not used. The shader only needs a valid parameter. The second issue ("arrowsGridTexture") is solved by setting proper default values for the parameters which generate the arrows grid texture. This ensure to generate a valid texture image . This also does not change anything in the shader code. The parameter is not used. The shader only needs a valid parameter.
- Loading branch information