Docs: GPU Shader: improvements
Changes: - line break - enum highlighting - better description
This commit is contained in:
parent
af3f744b41
commit
b7cb7b78a8
Notes:
blender-bot
2023-02-13 20:17:02 +01:00
Referenced by issue #83529, Horizontal stripe artifacts in image editor
|
@ -665,7 +665,7 @@ PyDoc_STRVAR(
|
|||
".. class:: GPUShader(vertexcode, fragcode, geocode=None, libcode=None, defines=None)\n"
|
||||
"\n"
|
||||
" GPUShader combines multiple GLSL shaders into a program used for drawing.\n"
|
||||
" It must contain a vertex and fragment shaders, with an optional geometry shader.\n"
|
||||
" It must contain at least a vertex and fragment shaders.\n"
|
||||
"\n"
|
||||
" The GLSL ``#version`` directive is automatically included at the top of shaders,\n"
|
||||
" and set to 330. Some preprocessor directives are automatically added according to\n"
|
||||
|
@ -722,9 +722,10 @@ PyDoc_STRVAR(pygpu_shader_from_builtin_doc,
|
|||
" Shaders that are embedded in the blender internal code.\n"
|
||||
" They all read the uniform ``mat4 ModelViewProjectionMatrix``,\n"
|
||||
" which can be edited by the :mod:`gpu.matrix` module.\n"
|
||||
"\n"
|
||||
" You can also choose a shader configuration that uses clip_planes by setting the "
|
||||
"``CLIPPED`` value to the config parameter. Note that in this case you also need to "
|
||||
"manually set the value of ``ModelMatrix``.\n"
|
||||
"manually set the value of ``mat4 ModelMatrix``.\n"
|
||||
"\n"
|
||||
" For more details, you can check the shader code with the\n"
|
||||
" :func:`gpu.shader.code_from_builtin` function.\n"
|
||||
|
@ -733,6 +734,7 @@ PyDoc_STRVAR(pygpu_shader_from_builtin_doc,
|
|||
"\n" PYDOC_BUILTIN_SHADER_LIST
|
||||
" :type shader_name: str\n"
|
||||
" :param config: One of these types of shader configuration:\n"
|
||||
"\n"
|
||||
" - ``DEFAULT``\n"
|
||||
" - ``CLIPPED``\n"
|
||||
" :type config: str\n"
|
||||
|
@ -766,7 +768,7 @@ static PyObject *pygpu_shader_from_builtin(PyObject *UNUSED(self), PyObject *arg
|
|||
PyDoc_STRVAR(pygpu_shader_code_from_builtin_doc,
|
||||
".. function:: code_from_builtin(pygpu_shader_name)\n"
|
||||
"\n"
|
||||
" Exposes the internal shader code for query.\n"
|
||||
" Exposes the internal shader code for consultation.\n"
|
||||
"\n"
|
||||
" :param pygpu_shader_name: One of these builtin shader names:\n"
|
||||
"\n" PYDOC_BUILTIN_SHADER_LIST
|
||||
|
@ -828,27 +830,28 @@ PyDoc_STRVAR(pygpu_shader_module__tp_doc,
|
|||
".. rubric:: Built-in shaders\n"
|
||||
"\n"
|
||||
"All built-in shaders have the ``mat4 ModelViewProjectionMatrix`` uniform.\n"
|
||||
"The value of it can only be modified using the :class:`gpu.matrix` module.\n"
|
||||
"\n"
|
||||
"2D_UNIFORM_COLOR\n"
|
||||
"Its value must be modified using the :class:`gpu.matrix` module.\n"
|
||||
"\n"
|
||||
"``2D_UNIFORM_COLOR``\n"
|
||||
" :Attributes: vec3 pos\n"
|
||||
" :Uniforms: vec4 color\n"
|
||||
"2D_FLAT_COLOR\n"
|
||||
"``2D_FLAT_COLOR``\n"
|
||||
" :Attributes: vec3 pos, vec4 color\n"
|
||||
" :Uniforms: none\n"
|
||||
"2D_SMOOTH_COLOR\n"
|
||||
"``2D_SMOOTH_COLOR``\n"
|
||||
" :Attributes: vec3 pos, vec4 color\n"
|
||||
" :Uniforms: none\n"
|
||||
"2D_IMAGE\n"
|
||||
"``2D_IMAGE``\n"
|
||||
" :Attributes: vec3 pos, vec2 texCoord\n"
|
||||
" :Uniforms: sampler2D image\n"
|
||||
"3D_UNIFORM_COLOR\n"
|
||||
"``3D_UNIFORM_COLOR``\n"
|
||||
" :Attributes: vec3 pos\n"
|
||||
" :Uniforms: vec4 color\n"
|
||||
"3D_FLAT_COLOR\n"
|
||||
"``3D_FLAT_COLOR``\n"
|
||||
" :Attributes: vec3 pos, vec4 color\n"
|
||||
" :Uniforms: none\n"
|
||||
"3D_SMOOTH_COLOR\n"
|
||||
"``3D_SMOOTH_COLOR``\n"
|
||||
" :Attributes: vec3 pos, vec4 color\n"
|
||||
" :Uniforms: none\n");
|
||||
static PyModuleDef pygpu_shader_module_def = {
|
||||
|
|
Loading…
Reference in New Issue