From b7cb7b78a87dbf19d6aefe2736df7f873476bf72 Mon Sep 17 00:00:00 2001 From: Germano Cavalcante Date: Mon, 30 Aug 2021 15:12:57 -0300 Subject: Docs: GPU Shader: improvements Changes: - line break - enum highlighting - better description --- source/blender/python/gpu/gpu_py_shader.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'source/blender/python') diff --git a/source/blender/python/gpu/gpu_py_shader.c b/source/blender/python/gpu/gpu_py_shader.c index c7b59ee0d6e..95e505b1343 100644 --- a/source/blender/python/gpu/gpu_py_shader.c +++ b/source/blender/python/gpu/gpu_py_shader.c @@ -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 = { -- cgit v1.2.3