Fix #139565: PyGPU: Add builtin point shaders
This PR adds builtin shaders for drawing points. Using `FLAT_COLOR`, `SMOOTH_COLOR`, `UNIFORM_COLOR` can lead to undesired behavior on Metal and Vulkan backends. To ensure future compatibility this PR adds `POINT_FLAT_COLOR` and `POINT_UNIFORM_COLOR`. The point size can be set using `gpu.state.point_size_set`. Pull Request: https://projects.blender.org/blender/blender/pulls/139583
This commit is contained in:
@@ -104,6 +104,8 @@ enum eGPUBuiltinShader {
|
||||
*/
|
||||
GPU_SHADER_3D_FLAT_COLOR,
|
||||
GPU_SHADER_3D_POLYLINE_FLAT_COLOR,
|
||||
GPU_SHADER_3D_POINT_FLAT_COLOR,
|
||||
|
||||
/**
|
||||
* Take a 3D position and color for each vertex with perspective correct interpolation.
|
||||
*
|
||||
@@ -112,6 +114,7 @@ enum eGPUBuiltinShader {
|
||||
*/
|
||||
GPU_SHADER_3D_SMOOTH_COLOR,
|
||||
GPU_SHADER_3D_POLYLINE_SMOOTH_COLOR,
|
||||
|
||||
/**
|
||||
* Take a single color for all the vertices and a 3D position for each vertex.
|
||||
*
|
||||
@@ -120,6 +123,8 @@ enum eGPUBuiltinShader {
|
||||
*/
|
||||
GPU_SHADER_3D_UNIFORM_COLOR,
|
||||
GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR,
|
||||
GPU_SHADER_3D_POINT_UNIFORM_COLOR,
|
||||
|
||||
/**
|
||||
* Draw a texture in 3D. Take a 3D position and a 2D texture coordinate for each vertex.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user