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

node_uv_map.osl « shaders « osl « kernel « cycles « intern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 591ab3aaa6b6a378e2d661fe978d6a19105a53d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* SPDX-License-Identifier: Apache-2.0
 * Copyright 2011-2022 Blender Foundation */

#include "stdcycles.h"

shader node_uv_map(int from_dupli = 0,
                   string attribute = "",
                   string bump_offset = "center",
                   output point UV = point(0.0, 0.0, 0.0))
{
  if (from_dupli) {
    getattribute("geom:dupli_uv", UV);
  }
  else {
    if (attribute == "")
      getattribute("geom:uv", UV);
    else
      getattribute(attribute, UV);
  }

  if (bump_offset == "dx") {
    if (!from_dupli) {
      UV += Dx(UV);
    }
  }
  else if (bump_offset == "dy") {
    if (!from_dupli) {
      UV += Dy(UV);
    }
  }
}