Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/python/gpu/gpu_py_shader.c')
-rw-r--r--source/blender/python/gpu/gpu_py_shader.c85
1 files changed, 38 insertions, 47 deletions
diff --git a/source/blender/python/gpu/gpu_py_shader.c b/source/blender/python/gpu/gpu_py_shader.c
index 4569e64eb62..19d6c8070f8 100644
--- a/source/blender/python/gpu/gpu_py_shader.c
+++ b/source/blender/python/gpu/gpu_py_shader.c
@@ -145,7 +145,7 @@ static PyObject *bpygpu_shader_new(PyTypeObject *UNUSED(type), PyObject *args, P
PyDoc_STRVAR(bpygpu_shader_bind_doc,
".. method:: bind()\n"
"\n"
-" Bind the Shader object.\n"
+" Bind the shader object. Required to be able to change uniforms of this shader. \n"
);
static PyObject *bpygpu_shader_bind(BPyGPUShader *self)
{
@@ -159,7 +159,7 @@ PyDoc_STRVAR(bpygpu_shader_transform_feedback_enable_doc,
" Start transform feedback operation.\n"
"\n"
" :return: true if transform feedback was succesfully enabled.\n"
-" :rtype: bool\n"
+" :rtype: `bool`\n"
);
static PyObject *bpygpu_shader_transform_feedback_enable(
BPyGPUShader *self, PyObject *arg)
@@ -187,10 +187,10 @@ PyDoc_STRVAR(bpygpu_shader_uniform_from_name_doc,
"\n"
" Get uniform location by name.\n"
"\n"
-" :param name: name of the uniform variable whose location is to be queried.\n"
-" :type name: str\n"
-" :return: the location of the uniform variable.\n"
-" :rtype: int\n"
+" :param name: Name of the uniform variable whose location is to be queried.\n"
+" :type name: `str`\n"
+" :return: Location of the uniform variable.\n"
+" :rtype: `int`\n"
);
static PyObject *bpygpu_shader_uniform_from_name(
BPyGPUShader *self, PyObject *arg)
@@ -215,10 +215,10 @@ PyDoc_STRVAR(bpygpu_shader_uniform_block_from_name_doc,
"\n"
" Get uniform block location by name.\n"
"\n"
-" :param name: name of the uniform block variable whose location is to be queried.\n"
-" :type name: str\n"
-" :return: the location of the uniform block variable.\n"
-" :rtype: int\n"
+" :param name: Name of the uniform block variable whose location is to be queried.\n"
+" :type name: `str`\n"
+" :return: The location of the uniform block variable.\n"
+" :rtype: `int`\n"
);
static PyObject *bpygpu_shader_uniform_block_from_name(
BPyGPUShader *self, PyObject *arg)
@@ -273,12 +273,11 @@ PyDoc_STRVAR(bpygpu_shader_uniform_vector_float_doc,
"\n"
" Set the buffer to fill the uniform.\n"
"\n"
-" :param location: location of the uniform variable to be modified.\n"
+" :param location: Location of the uniform variable to be modified.\n"
" :type location: int\n"
-" :param buffer: buffer object with format float.\n"
-" :type buffer: buffer object\n"
-" :param length:\n"
-" size of the uniform data type:\n"
+" :param buffer: The data that should be set. Can support the buffer protocol.\n"
+" :type buffer: sequence of floats\n"
+" :param length: Size of the uniform data type:\n"
"\n"
" - 1: float\n"
" - 2: vec2 or float[2]\n"
@@ -288,7 +287,7 @@ PyDoc_STRVAR(bpygpu_shader_uniform_vector_float_doc,
" - 16: mat4\n"
"\n"
" :type length: int\n"
-" :param count: specifies the number of elements, vector or matrices that are to be modified.\n"
+" :param count: Specifies the number of elements, vector or matrices that are to be modified.\n"
" :type count: int\n"
);
static PyObject *bpygpu_shader_uniform_vector_float(
@@ -347,9 +346,9 @@ PyDoc_STRVAR(bpygpu_shader_uniform_bool_doc,
"\n"
" Specify the value of a uniform variable for the current program object.\n"
"\n"
-" :param name: name of the uniform variable whose location is to be queried.\n"
+" :param name: Name of the uniform variable whose value is to be changed.\n"
" :type name: str\n"
-" :param seq: values that will be used to update the specified uniform variable.\n"
+" :param seq: Value that will be used to update the specified uniform variable.\n"
" :type seq: sequence of bools\n"
);
static PyObject *bpygpu_shader_uniform_bool(
@@ -417,9 +416,9 @@ PyDoc_STRVAR(bpygpu_shader_uniform_float_doc,
"\n"
" Specify the value of a uniform variable for the current program object.\n"
"\n"
-" :param name: name of the uniform variable whose location is to be queried.\n"
+" :param name: Name of the uniform variable whose value is to be changed.\n"
" :type name: str\n"
-" :param value: values that will be used to update the specified uniform variable.\n"
+" :param value: Value that will be used to update the specified uniform variable.\n"
" :type value: single number or sequence of numbers\n"
);
static PyObject *bpygpu_shader_uniform_float(
@@ -493,9 +492,9 @@ PyDoc_STRVAR(bpygpu_shader_uniform_int_doc,
"\n"
" Specify the value of a uniform variable for the current program object.\n"
"\n"
-" :param name: name of the uniform variable whose location is to be queried.\n"
+" :param name: name of the uniform variable whose value is to be changed.\n"
" :type name: str\n"
-" :param seq: values that will be used to update the specified uniform variable.\n"
+" :param seq: Value that will be used to update the specified uniform variable.\n"
" :type seq: sequence of numbers\n"
);
static PyObject *bpygpu_shader_uniform_int(
@@ -569,9 +568,9 @@ PyDoc_STRVAR(bpygpu_shader_attr_from_name_doc,
"\n"
" Get attribute location by name.\n"
"\n"
-" :param name: the name of the attribute variable whose location is to be queried.\n"
+" :param name: The name of the attribute variable whose location is to be queried.\n"
" :type name: str\n"
-" :return: the location of an attribute variable.\n"
+" :return: The location of an attribute variable.\n"
" :rtype: int\n"
);
static PyObject *bpygpu_shader_attr_from_name(
@@ -673,38 +672,30 @@ static void bpygpu_shader_dealloc(BPyGPUShader *self)
PyDoc_STRVAR(bpygpu_shader_doc,
-"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"
-"\n"
-"The GLSL #version directive is automatically included at the top of shaders, and set to 330.\n"
-"\n"
-"Some preprocessor directives are automatically added according to the Operating System or availability.\n"
-"\n"
-"These are::\n"
+".. class:: GPUShader(vertexcode, fragcode, geocode=None, libcode=None, defines=None)\n"
"\n"
-" \"#define GPU_ATI\\n\"\n"
-" \"#define GPU_NVIDIA\\n\"\n"
-" \"#define GPU_INTEL\\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"
"\n"
-"The following extensions are enabled by default if supported by the GPU::\n"
+" The GLSL #version directive is automatically included at the top of shaders, and set to 330.\n"
+" Some preprocessor directives are automatically added according to the Operating System or availability:\n"
+" ``GPU_ATI``, ``GPU_NVIDIA`` and ``GPU_INTEL``.\n"
"\n"
-" \"#extension GL_ARB_texture_gather: enable\\n\"\n"
-" \"#extension GL_ARB_texture_query_lod: enable\\n\"\n"
+" The following extensions are enabled by default if supported by the GPU:\n"
+" ``GL_ARB_texture_gather`` and ``GL_ARB_texture_query_lod``.\n"
"\n"
-"To debug shaders, use the --debug-gpu-shaders command line option"
-" to see full GLSL shader compilation and linking errors.\n"
+" To debug shaders, use the --debug-gpu-shaders command line option"
+" to see full GLSL shader compilation and linking errors.\n"
"\n"
-" :param vertexcode: vertex Shader Code.\n"
+" :param vertexcode: Vertex shader code.\n"
" :type vertexcode: str\n"
-" :param fragcode: fragment Shader Code.\n"
+" :param fragcode: Fragment shader code.\n"
" :type value: str\n"
-" :param geocode: geometry Shader Code.\n"
+" :param geocode: Geometry shader code.\n"
" :type value: str\n"
-" :param libcode: code with functions and presets to be shared between shaders.\n"
+" :param libcode: Code with functions and presets to be shared between shaders.\n"
" :type value: str\n"
-" :param defines: preprocessor directives.\n"
+" :param defines: Preprocessor directives.\n"
" :type value: str\n"
);
PyTypeObject BPyGPUShader_Type = {