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/nodes/shader/nodes/node_shader_geom.c')
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_geom.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_geom.c b/source/blender/nodes/shader/nodes/node_shader_geom.c
index 208f141e3ef..cf0dcc4e27c 100644
--- a/source/blender/nodes/shader/nodes/node_shader_geom.c
+++ b/source/blender/nodes/shader/nodes/node_shader_geom.c
@@ -54,17 +54,17 @@ static bNodeSocketTemplate sh_node_geom_out[] = {
static void node_shader_exec_geom(void *data, int UNUSED(thread), bNode *node, bNodeExecData *UNUSED(execdata), bNodeStack **UNUSED(in), bNodeStack **out)
{
if (data) {
- ShadeInput *shi= ((ShaderCallData *)data)->shi;
- NodeGeometry *ngeo= (NodeGeometry*)node->storage;
- ShadeInputUV *suv= &shi->uv[shi->actuv];
+ ShadeInput *shi = ((ShaderCallData *)data)->shi;
+ NodeGeometry *ngeo = (NodeGeometry *)node->storage;
+ ShadeInputUV *suv = &shi->uv[shi->actuv];
static float defaultvcol[4] = {1.0f, 1.0f, 1.0f, 1.0f};
int i;
if (ngeo->uvname[0]) {
/* find uv map by name */
for (i = 0; i < shi->totuv; i++) {
- if (strcmp(shi->uv[i].name, ngeo->uvname)==0) {
- suv= &shi->uv[i];
+ if (strcmp(shi->uv[i].name, ngeo->uvname) == 0) {
+ suv = &shi->uv[i];
break;
}
}
@@ -80,12 +80,12 @@ static void node_shader_exec_geom(void *data, int UNUSED(thread), bNode *node, b
if (shi->totcol) {
/* find vertex color layer by name */
- ShadeInputCol *scol= &shi->col[0];
+ ShadeInputCol *scol = &shi->col[0];
if (ngeo->colname[0]) {
for (i = 0; i < shi->totcol; i++) {
- if (strcmp(shi->col[i].name, ngeo->colname)==0) {
- scol= &shi->col[i];
+ if (strcmp(shi->col[i].name, ngeo->colname) == 0) {
+ scol = &shi->col[i];
break;
}
}
@@ -101,18 +101,18 @@ static void node_shader_exec_geom(void *data, int UNUSED(thread), bNode *node, b
}
if (shi->osatex) {
- out[GEOM_OUT_GLOB]->data= shi->dxgl;
- out[GEOM_OUT_GLOB]->datatype= NS_OSA_VECTORS;
- out[GEOM_OUT_LOCAL]->data= shi->dxco;
- out[GEOM_OUT_LOCAL]->datatype= NS_OSA_VECTORS;
- out[GEOM_OUT_VIEW]->data= &shi->dxview;
- out[GEOM_OUT_VIEW]->datatype= NS_OSA_VALUES;
- out[GEOM_OUT_ORCO]->data= shi->dxlo;
- out[GEOM_OUT_ORCO]->datatype= NS_OSA_VECTORS;
- out[GEOM_OUT_UV]->data= suv->dxuv;
- out[GEOM_OUT_UV]->datatype= NS_OSA_VECTORS;
- out[GEOM_OUT_NORMAL]->data= shi->dxno;
- out[GEOM_OUT_NORMAL]->datatype= NS_OSA_VECTORS;
+ out[GEOM_OUT_GLOB]->data = shi->dxgl;
+ out[GEOM_OUT_GLOB]->datatype = NS_OSA_VECTORS;
+ out[GEOM_OUT_LOCAL]->data = shi->dxco;
+ out[GEOM_OUT_LOCAL]->datatype = NS_OSA_VECTORS;
+ out[GEOM_OUT_VIEW]->data = &shi->dxview;
+ out[GEOM_OUT_VIEW]->datatype = NS_OSA_VALUES;
+ out[GEOM_OUT_ORCO]->data = shi->dxlo;
+ out[GEOM_OUT_ORCO]->datatype = NS_OSA_VECTORS;
+ out[GEOM_OUT_UV]->data = suv->dxuv;
+ out[GEOM_OUT_UV]->datatype = NS_OSA_VECTORS;
+ out[GEOM_OUT_NORMAL]->data = shi->dxno;
+ out[GEOM_OUT_NORMAL]->datatype = NS_OSA_VECTORS;
}
/* front/back, normal flipping was stored */
@@ -122,19 +122,19 @@ static void node_shader_exec_geom(void *data, int UNUSED(thread), bNode *node, b
static void node_shader_init_geometry(bNodeTree *UNUSED(ntree), bNode *node)
{
- node->storage= MEM_callocN(sizeof(NodeGeometry), "NodeGeometry");
+ node->storage = MEM_callocN(sizeof(NodeGeometry), "NodeGeometry");
}
static int gpu_shader_geom(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
{
- NodeGeometry *ngeo= (NodeGeometry*)node->storage;
+ NodeGeometry *ngeo = (NodeGeometry *)node->storage;
GPUNodeLink *orco = GPU_attribute(CD_ORCO, "");
GPUNodeLink *mtface = GPU_attribute(CD_MTFACE, ngeo->uvname);
GPUNodeLink *mcol = GPU_attribute(CD_MCOL, ngeo->colname);
return GPU_stack_link(mat, "geom", in, out,
- GPU_builtin(GPU_VIEW_POSITION), GPU_builtin(GPU_VIEW_NORMAL),
- GPU_builtin(GPU_INVERSE_VIEW_MATRIX), orco, mtface, mcol);
+ GPU_builtin(GPU_VIEW_POSITION), GPU_builtin(GPU_VIEW_NORMAL),
+ GPU_builtin(GPU_INVERSE_VIEW_MATRIX), orco, mtface, mcol);
}
/* node type definition */