2011-04-27 11:58:34 +00:00
|
|
|
/*
|
2013-08-18 14:16:15 +00:00
|
|
|
* Copyright 2011-2013 Blender Foundation
|
2011-04-27 11:58:34 +00:00
|
|
|
*
|
2013-08-18 14:16:15 +00:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
2011-04-27 11:58:34 +00:00
|
|
|
*
|
2013-08-18 14:16:15 +00:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2011-04-27 11:58:34 +00:00
|
|
|
*
|
2013-08-18 14:16:15 +00:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
2014-12-25 01:50:24 +00:00
|
|
|
* limitations under the License.
|
2011-04-27 11:58:34 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __NODES_H__
|
|
|
|
#define __NODES_H__
|
|
|
|
|
|
|
|
#include "graph.h"
|
|
|
|
|
|
|
|
#include "util_string.h"
|
|
|
|
|
|
|
|
CCL_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
class ImageManager;
|
2012-12-12 06:51:06 +00:00
|
|
|
class Shader;
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-10-12 22:42:13 +00:00
|
|
|
/* Texture Mapping */
|
|
|
|
|
|
|
|
class TextureMapping {
|
|
|
|
public:
|
|
|
|
TextureMapping();
|
|
|
|
Transform compute_transform();
|
|
|
|
bool skip();
|
|
|
|
void compile(SVMCompiler& compiler, int offset_in, int offset_out);
|
2012-11-20 17:40:10 +00:00
|
|
|
void compile(OSLCompiler &compiler);
|
2011-10-12 22:42:13 +00:00
|
|
|
|
|
|
|
float3 translation;
|
|
|
|
float3 rotation;
|
|
|
|
float3 scale;
|
|
|
|
|
2012-05-07 20:24:38 +00:00
|
|
|
float3 min, max;
|
|
|
|
bool use_minmax;
|
|
|
|
|
2013-09-25 20:28:49 +00:00
|
|
|
enum Type { POINT = 0, TEXTURE = 1, VECTOR = 2, NORMAL = 3 };
|
|
|
|
Type type;
|
|
|
|
|
2012-06-09 18:56:12 +00:00
|
|
|
enum Mapping { NONE = 0, X = 1, Y = 2, Z = 3 };
|
2011-10-12 22:42:13 +00:00
|
|
|
Mapping x_mapping, y_mapping, z_mapping;
|
|
|
|
|
|
|
|
enum Projection { FLAT, CUBE, TUBE, SPHERE };
|
|
|
|
Projection projection;
|
|
|
|
};
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
/* Nodes */
|
|
|
|
|
2015-04-02 15:37:57 +00:00
|
|
|
/* Any node which uses image manager's slot should be a subclass of this one. */
|
|
|
|
class ImageSlotNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
ImageSlotNode(const char *name_) : ShaderNode(name_) {
|
|
|
|
special_type = SHADER_SPECIAL_TYPE_IMAGE_SLOT;
|
|
|
|
}
|
|
|
|
int slot;
|
|
|
|
};
|
|
|
|
|
2011-10-12 22:42:13 +00:00
|
|
|
class TextureNode : public ShaderNode {
|
|
|
|
public:
|
2012-06-09 18:20:40 +00:00
|
|
|
TextureNode(const char *name_) : ShaderNode(name_) {}
|
2011-10-12 22:42:13 +00:00
|
|
|
TextureMapping tex_mapping;
|
|
|
|
};
|
|
|
|
|
2015-04-02 15:37:57 +00:00
|
|
|
class ImageSlotTextureNode : public ImageSlotNode {
|
|
|
|
public:
|
|
|
|
ImageSlotTextureNode(const char *name_) : ImageSlotNode(name_) {}
|
|
|
|
TextureMapping tex_mapping;
|
|
|
|
};
|
|
|
|
|
|
|
|
class ImageTextureNode : public ImageSlotTextureNode {
|
2011-04-27 11:58:34 +00:00
|
|
|
public:
|
|
|
|
SHADER_NODE_NO_CLONE_CLASS(ImageTextureNode)
|
|
|
|
~ImageTextureNode();
|
|
|
|
ShaderNode *clone() const;
|
2013-12-31 16:30:34 +00:00
|
|
|
void attributes(Shader *shader, AttributeRequestSet *attributes);
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
ImageManager *image_manager;
|
2012-11-20 17:40:10 +00:00
|
|
|
int is_float;
|
2013-02-14 21:40:29 +00:00
|
|
|
bool is_linear;
|
2014-05-07 14:36:44 +00:00
|
|
|
bool use_alpha;
|
2011-04-27 11:58:34 +00:00
|
|
|
string filename;
|
2013-01-30 13:42:12 +00:00
|
|
|
void *builtin_data;
|
2011-05-13 14:32:08 +00:00
|
|
|
ustring color_space;
|
2012-09-04 13:29:07 +00:00
|
|
|
ustring projection;
|
2014-03-07 22:16:09 +00:00
|
|
|
InterpolationType interpolation;
|
2012-09-04 13:29:07 +00:00
|
|
|
float projection_blend;
|
2012-11-21 13:00:51 +00:00
|
|
|
bool animated;
|
2011-05-13 14:32:08 +00:00
|
|
|
|
|
|
|
static ShaderEnum color_space_enum;
|
2012-09-04 13:29:07 +00:00
|
|
|
static ShaderEnum projection_enum;
|
2011-04-27 11:58:34 +00:00
|
|
|
};
|
|
|
|
|
2015-04-02 15:37:57 +00:00
|
|
|
class EnvironmentTextureNode : public ImageSlotTextureNode {
|
2011-04-27 11:58:34 +00:00
|
|
|
public:
|
|
|
|
SHADER_NODE_NO_CLONE_CLASS(EnvironmentTextureNode)
|
|
|
|
~EnvironmentTextureNode();
|
|
|
|
ShaderNode *clone() const;
|
2013-12-31 16:30:34 +00:00
|
|
|
void attributes(Shader *shader, AttributeRequestSet *attributes);
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
ImageManager *image_manager;
|
2012-11-20 17:40:10 +00:00
|
|
|
int is_float;
|
2013-02-14 21:40:29 +00:00
|
|
|
bool is_linear;
|
2014-05-07 14:36:44 +00:00
|
|
|
bool use_alpha;
|
2011-04-27 11:58:34 +00:00
|
|
|
string filename;
|
2013-01-30 13:42:12 +00:00
|
|
|
void *builtin_data;
|
2011-05-13 14:32:08 +00:00
|
|
|
ustring color_space;
|
2012-03-08 19:52:58 +00:00
|
|
|
ustring projection;
|
2012-11-21 13:00:51 +00:00
|
|
|
bool animated;
|
2011-05-13 14:32:08 +00:00
|
|
|
|
|
|
|
static ShaderEnum color_space_enum;
|
2012-03-08 19:52:58 +00:00
|
|
|
static ShaderEnum projection_enum;
|
2011-04-27 11:58:34 +00:00
|
|
|
};
|
|
|
|
|
2011-10-12 22:42:13 +00:00
|
|
|
class SkyTextureNode : public TextureNode {
|
2011-04-27 11:58:34 +00:00
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(SkyTextureNode)
|
|
|
|
|
|
|
|
float3 sun_direction;
|
|
|
|
float turbidity;
|
2013-08-28 14:11:28 +00:00
|
|
|
float ground_albedo;
|
|
|
|
|
|
|
|
ustring type;
|
|
|
|
static ShaderEnum type_enum;
|
2011-04-27 11:58:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class OutputNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(OutputNode)
|
|
|
|
};
|
|
|
|
|
2011-11-06 21:05:58 +00:00
|
|
|
class GradientTextureNode : public TextureNode {
|
2011-04-27 11:58:34 +00:00
|
|
|
public:
|
2011-11-06 21:05:58 +00:00
|
|
|
SHADER_NODE_CLASS(GradientTextureNode)
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-11-06 21:05:58 +00:00
|
|
|
ustring type;
|
|
|
|
static ShaderEnum type_enum;
|
2011-04-27 11:58:34 +00:00
|
|
|
};
|
|
|
|
|
2011-11-06 21:05:58 +00:00
|
|
|
class NoiseTextureNode : public TextureNode {
|
2011-04-27 11:58:34 +00:00
|
|
|
public:
|
2011-11-06 21:05:58 +00:00
|
|
|
SHADER_NODE_CLASS(NoiseTextureNode)
|
2011-04-27 11:58:34 +00:00
|
|
|
};
|
|
|
|
|
2011-10-12 22:42:13 +00:00
|
|
|
class VoronoiTextureNode : public TextureNode {
|
2011-04-27 11:58:34 +00:00
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(VoronoiTextureNode)
|
|
|
|
|
|
|
|
ustring coloring;
|
|
|
|
|
|
|
|
static ShaderEnum coloring_enum;
|
|
|
|
};
|
|
|
|
|
2011-10-12 22:42:13 +00:00
|
|
|
class MusgraveTextureNode : public TextureNode {
|
2011-04-27 11:58:34 +00:00
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(MusgraveTextureNode)
|
|
|
|
|
|
|
|
ustring type;
|
|
|
|
|
|
|
|
static ShaderEnum type_enum;
|
|
|
|
};
|
|
|
|
|
2011-11-06 21:05:58 +00:00
|
|
|
class WaveTextureNode : public TextureNode {
|
2011-04-27 11:58:34 +00:00
|
|
|
public:
|
2011-11-06 21:05:58 +00:00
|
|
|
SHADER_NODE_CLASS(WaveTextureNode)
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
ustring type;
|
|
|
|
static ShaderEnum type_enum;
|
|
|
|
};
|
|
|
|
|
2011-10-12 22:42:13 +00:00
|
|
|
class MagicTextureNode : public TextureNode {
|
2011-04-27 11:58:34 +00:00
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(MagicTextureNode)
|
|
|
|
|
|
|
|
int depth;
|
|
|
|
};
|
|
|
|
|
2012-01-08 14:55:43 +00:00
|
|
|
class CheckerTextureNode : public TextureNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(CheckerTextureNode)
|
|
|
|
};
|
|
|
|
|
2012-09-04 13:29:07 +00:00
|
|
|
class BrickTextureNode : public TextureNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(BrickTextureNode)
|
|
|
|
|
|
|
|
float offset, squash;
|
|
|
|
int offset_frequency, squash_frequency;
|
|
|
|
};
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
class MappingNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(MappingNode)
|
|
|
|
|
2011-10-12 22:42:13 +00:00
|
|
|
TextureMapping tex_mapping;
|
2011-04-27 11:58:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class ConvertNode : public ShaderNode {
|
|
|
|
public:
|
2013-06-23 19:24:32 +00:00
|
|
|
ConvertNode(ShaderSocketType from, ShaderSocketType to, bool autoconvert = false);
|
2011-04-27 11:58:34 +00:00
|
|
|
SHADER_NODE_BASE_CLASS(ConvertNode)
|
|
|
|
|
|
|
|
ShaderSocketType from, to;
|
|
|
|
};
|
|
|
|
|
2011-12-18 15:34:06 +00:00
|
|
|
class ProxyNode : public ShaderNode {
|
|
|
|
public:
|
2013-03-18 16:34:57 +00:00
|
|
|
ProxyNode(ShaderSocketType type);
|
2011-12-18 15:34:06 +00:00
|
|
|
SHADER_NODE_BASE_CLASS(ProxyNode)
|
|
|
|
|
2013-03-18 16:34:57 +00:00
|
|
|
ShaderSocketType type;
|
2011-12-18 15:34:06 +00:00
|
|
|
};
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
class BsdfNode : public ShaderNode {
|
|
|
|
public:
|
2013-04-01 20:26:52 +00:00
|
|
|
BsdfNode(bool scattering = false);
|
|
|
|
SHADER_NODE_BASE_CLASS(BsdfNode);
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2014-04-03 20:04:39 +00:00
|
|
|
bool has_spatial_varying() { return true; }
|
2013-09-03 22:39:17 +00:00
|
|
|
void compile(SVMCompiler& compiler, ShaderInput *param1, ShaderInput *param2, ShaderInput *param3 = NULL, ShaderInput *param4 = NULL);
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
ClosureType closure;
|
2013-04-01 20:26:52 +00:00
|
|
|
bool scattering;
|
2011-04-27 11:58:34 +00:00
|
|
|
};
|
|
|
|
|
2014-06-08 10:16:28 +00:00
|
|
|
class AnisotropicBsdfNode : public BsdfNode {
|
2011-04-27 11:58:34 +00:00
|
|
|
public:
|
2014-06-08 10:16:28 +00:00
|
|
|
SHADER_NODE_CLASS(AnisotropicBsdfNode)
|
|
|
|
|
|
|
|
ustring distribution;
|
|
|
|
static ShaderEnum distribution_enum;
|
|
|
|
|
2013-12-31 16:30:34 +00:00
|
|
|
void attributes(Shader *shader, AttributeRequestSet *attributes);
|
2011-04-27 11:58:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class DiffuseBsdfNode : public BsdfNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(DiffuseBsdfNode)
|
|
|
|
};
|
|
|
|
|
|
|
|
class TranslucentBsdfNode : public BsdfNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(TranslucentBsdfNode)
|
|
|
|
};
|
|
|
|
|
|
|
|
class TransparentBsdfNode : public BsdfNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(TransparentBsdfNode)
|
2012-12-12 06:51:06 +00:00
|
|
|
|
|
|
|
bool has_surface_transparent() { return true; }
|
2011-04-27 11:58:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class VelvetBsdfNode : public BsdfNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(VelvetBsdfNode)
|
|
|
|
};
|
|
|
|
|
|
|
|
class GlossyBsdfNode : public BsdfNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(GlossyBsdfNode)
|
|
|
|
|
|
|
|
ustring distribution;
|
|
|
|
static ShaderEnum distribution_enum;
|
|
|
|
};
|
|
|
|
|
|
|
|
class GlassBsdfNode : public BsdfNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(GlassBsdfNode)
|
|
|
|
|
|
|
|
ustring distribution;
|
|
|
|
static ShaderEnum distribution_enum;
|
|
|
|
};
|
|
|
|
|
2012-11-06 19:59:02 +00:00
|
|
|
class RefractionBsdfNode : public BsdfNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(RefractionBsdfNode)
|
|
|
|
|
|
|
|
ustring distribution;
|
|
|
|
static ShaderEnum distribution_enum;
|
|
|
|
};
|
|
|
|
|
2013-05-23 17:45:20 +00:00
|
|
|
class ToonBsdfNode : public BsdfNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(ToonBsdfNode)
|
|
|
|
|
|
|
|
ustring component;
|
|
|
|
static ShaderEnum component_enum;
|
|
|
|
};
|
|
|
|
|
2013-04-01 20:26:52 +00:00
|
|
|
class SubsurfaceScatteringNode : public BsdfNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(SubsurfaceScatteringNode)
|
|
|
|
bool has_surface_bssrdf() { return true; }
|
2013-08-18 14:15:57 +00:00
|
|
|
bool has_bssrdf_bump();
|
2014-04-03 20:04:39 +00:00
|
|
|
bool has_spatial_varying() { return true; }
|
2013-08-18 14:15:57 +00:00
|
|
|
|
|
|
|
static ShaderEnum falloff_enum;
|
2013-04-01 20:26:52 +00:00
|
|
|
};
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
class EmissionNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(EmissionNode)
|
|
|
|
|
2012-12-12 06:51:06 +00:00
|
|
|
bool has_surface_emission() { return true; }
|
2014-04-03 20:04:39 +00:00
|
|
|
bool has_spatial_varying() { return true; }
|
2011-04-27 11:58:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class BackgroundNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(BackgroundNode)
|
|
|
|
};
|
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
class HoldoutNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(HoldoutNode)
|
|
|
|
};
|
|
|
|
|
2012-11-06 19:59:02 +00:00
|
|
|
class AmbientOcclusionNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(AmbientOcclusionNode)
|
2014-04-03 20:04:39 +00:00
|
|
|
|
|
|
|
bool has_spatial_varying() { return true; }
|
2012-11-06 19:59:02 +00:00
|
|
|
};
|
|
|
|
|
2011-09-27 20:03:16 +00:00
|
|
|
class VolumeNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(VolumeNode)
|
|
|
|
|
|
|
|
void compile(SVMCompiler& compiler, ShaderInput *param1, ShaderInput *param2);
|
|
|
|
|
|
|
|
ClosureType closure;
|
|
|
|
};
|
|
|
|
|
2013-12-28 00:54:44 +00:00
|
|
|
class AbsorptionVolumeNode : public VolumeNode {
|
2011-09-27 20:03:16 +00:00
|
|
|
public:
|
2013-12-28 00:54:44 +00:00
|
|
|
SHADER_NODE_CLASS(AbsorptionVolumeNode)
|
2011-09-27 20:03:16 +00:00
|
|
|
};
|
|
|
|
|
2013-12-28 00:54:44 +00:00
|
|
|
class ScatterVolumeNode : public VolumeNode {
|
2011-09-27 20:03:16 +00:00
|
|
|
public:
|
2013-12-28 00:54:44 +00:00
|
|
|
SHADER_NODE_CLASS(ScatterVolumeNode)
|
2011-09-27 20:03:16 +00:00
|
|
|
};
|
|
|
|
|
2013-09-15 23:58:00 +00:00
|
|
|
class HairBsdfNode : public BsdfNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(HairBsdfNode)
|
|
|
|
|
|
|
|
ustring component;
|
|
|
|
static ShaderEnum component_enum;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
class GeometryNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(GeometryNode)
|
2013-12-31 16:30:34 +00:00
|
|
|
void attributes(Shader *shader, AttributeRequestSet *attributes);
|
2014-04-03 20:04:39 +00:00
|
|
|
bool has_spatial_varying() { return true; }
|
2011-04-27 11:58:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class TextureCoordinateNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(TextureCoordinateNode)
|
2013-12-31 16:30:34 +00:00
|
|
|
void attributes(Shader *shader, AttributeRequestSet *attributes);
|
2014-04-03 20:04:39 +00:00
|
|
|
bool has_spatial_varying() { return true; }
|
2015-01-21 17:19:31 +00:00
|
|
|
bool has_object_dependency() { return use_transform; }
|
|
|
|
|
2012-10-04 21:40:39 +00:00
|
|
|
bool from_dupli;
|
2015-01-21 17:19:31 +00:00
|
|
|
bool use_transform;
|
|
|
|
Transform ob_tfm;
|
2011-04-27 11:58:34 +00:00
|
|
|
};
|
|
|
|
|
2014-04-02 09:40:29 +00:00
|
|
|
class UVMapNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(UVMapNode)
|
|
|
|
void attributes(Shader *shader, AttributeRequestSet *attributes);
|
2014-04-03 20:04:39 +00:00
|
|
|
bool has_spatial_varying() { return true; }
|
2014-04-02 09:40:29 +00:00
|
|
|
|
|
|
|
ustring attribute;
|
|
|
|
bool from_dupli;
|
|
|
|
};
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
class LightPathNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(LightPathNode)
|
|
|
|
};
|
|
|
|
|
2012-05-07 20:24:38 +00:00
|
|
|
class LightFalloffNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(LightFalloffNode)
|
2014-04-03 20:04:39 +00:00
|
|
|
bool has_spatial_varying() { return true; }
|
2012-05-07 20:24:38 +00:00
|
|
|
};
|
|
|
|
|
2012-05-21 12:52:28 +00:00
|
|
|
class ObjectInfoNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(ObjectInfoNode)
|
|
|
|
};
|
|
|
|
|
2012-06-08 16:17:57 +00:00
|
|
|
class ParticleInfoNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(ParticleInfoNode)
|
2013-12-31 16:30:34 +00:00
|
|
|
void attributes(Shader *shader, AttributeRequestSet *attributes);
|
2012-06-08 16:17:57 +00:00
|
|
|
};
|
|
|
|
|
2012-12-28 14:21:30 +00:00
|
|
|
class HairInfoNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(HairInfoNode)
|
2013-01-03 12:08:54 +00:00
|
|
|
|
2013-12-31 16:30:34 +00:00
|
|
|
void attributes(Shader *shader, AttributeRequestSet *attributes);
|
2014-04-03 20:04:39 +00:00
|
|
|
bool has_spatial_varying() { return true; }
|
2015-06-01 09:48:24 +00:00
|
|
|
virtual int get_feature() {
|
|
|
|
return ShaderNode::get_feature() | NODE_FEATURE_HAIR;
|
|
|
|
}
|
2012-12-28 14:21:30 +00:00
|
|
|
};
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
class ValueNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(ValueNode)
|
|
|
|
|
|
|
|
float value;
|
|
|
|
};
|
|
|
|
|
|
|
|
class ColorNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(ColorNode)
|
|
|
|
|
|
|
|
float3 value;
|
|
|
|
};
|
|
|
|
|
|
|
|
class AddClosureNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(AddClosureNode)
|
|
|
|
};
|
|
|
|
|
|
|
|
class MixClosureNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(MixClosureNode)
|
|
|
|
};
|
|
|
|
|
2012-11-26 21:59:41 +00:00
|
|
|
class MixClosureWeightNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(MixClosureWeightNode);
|
|
|
|
};
|
|
|
|
|
2011-12-03 23:05:35 +00:00
|
|
|
class InvertNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(InvertNode)
|
|
|
|
};
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
class MixNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(MixNode)
|
|
|
|
|
2012-08-30 06:31:02 +00:00
|
|
|
bool use_clamp;
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
ustring type;
|
|
|
|
static ShaderEnum type_enum;
|
|
|
|
};
|
|
|
|
|
2011-12-01 21:46:10 +00:00
|
|
|
class CombineRGBNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(CombineRGBNode)
|
|
|
|
};
|
|
|
|
|
2013-07-03 23:46:56 +00:00
|
|
|
class CombineHSVNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(CombineHSVNode)
|
|
|
|
};
|
|
|
|
|
2014-06-13 19:44:48 +00:00
|
|
|
class CombineXYZNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(CombineXYZNode)
|
|
|
|
};
|
|
|
|
|
2011-12-16 20:35:06 +00:00
|
|
|
class GammaNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(GammaNode)
|
|
|
|
};
|
|
|
|
|
2012-01-24 16:32:31 +00:00
|
|
|
class BrightContrastNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(BrightContrastNode)
|
|
|
|
};
|
|
|
|
|
2011-12-01 21:46:10 +00:00
|
|
|
class SeparateRGBNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(SeparateRGBNode)
|
|
|
|
};
|
|
|
|
|
2013-07-03 23:46:56 +00:00
|
|
|
class SeparateHSVNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(SeparateHSVNode)
|
|
|
|
};
|
|
|
|
|
2014-06-13 19:44:48 +00:00
|
|
|
class SeparateXYZNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(SeparateXYZNode)
|
|
|
|
};
|
|
|
|
|
2011-12-02 16:57:37 +00:00
|
|
|
class HSVNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(HSVNode)
|
|
|
|
};
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
class AttributeNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(AttributeNode)
|
2013-12-31 16:30:34 +00:00
|
|
|
void attributes(Shader *shader, AttributeRequestSet *attributes);
|
2014-04-03 20:04:39 +00:00
|
|
|
bool has_spatial_varying() { return true; }
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
ustring attribute;
|
|
|
|
};
|
|
|
|
|
2011-12-02 20:36:13 +00:00
|
|
|
class CameraNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(CameraNode)
|
2014-04-03 20:04:39 +00:00
|
|
|
bool has_spatial_varying() { return true; }
|
2011-12-02 20:36:13 +00:00
|
|
|
};
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
class FresnelNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(FresnelNode)
|
2014-04-03 20:04:39 +00:00
|
|
|
bool has_spatial_varying() { return true; }
|
2011-04-27 11:58:34 +00:00
|
|
|
};
|
|
|
|
|
2011-11-06 21:05:58 +00:00
|
|
|
class LayerWeightNode : public ShaderNode {
|
2011-09-16 13:14:02 +00:00
|
|
|
public:
|
2011-11-06 21:05:58 +00:00
|
|
|
SHADER_NODE_CLASS(LayerWeightNode)
|
2014-04-03 20:04:39 +00:00
|
|
|
bool has_spatial_varying() { return true; }
|
2011-09-16 13:14:02 +00:00
|
|
|
};
|
|
|
|
|
2013-05-20 15:58:37 +00:00
|
|
|
class WireframeNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(WireframeNode)
|
2014-04-03 20:04:39 +00:00
|
|
|
bool has_spatial_varying() { return true; }
|
2013-05-20 15:58:37 +00:00
|
|
|
|
|
|
|
bool use_pixel_size;
|
|
|
|
};
|
|
|
|
|
2013-06-09 20:46:22 +00:00
|
|
|
class WavelengthNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(WavelengthNode)
|
|
|
|
};
|
|
|
|
|
2013-07-31 20:56:32 +00:00
|
|
|
class BlackbodyNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(BlackbodyNode)
|
|
|
|
};
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
class MathNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(MathNode)
|
|
|
|
|
2012-08-29 17:30:14 +00:00
|
|
|
bool use_clamp;
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
ustring type;
|
|
|
|
static ShaderEnum type_enum;
|
|
|
|
};
|
|
|
|
|
2011-12-16 18:15:07 +00:00
|
|
|
class NormalNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(NormalNode)
|
|
|
|
|
|
|
|
float3 direction;
|
|
|
|
};
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
class VectorMathNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(VectorMathNode)
|
|
|
|
|
|
|
|
ustring type;
|
|
|
|
static ShaderEnum type_enum;
|
|
|
|
};
|
|
|
|
|
2013-07-31 21:18:23 +00:00
|
|
|
class VectorTransformNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(VectorTransformNode)
|
|
|
|
|
|
|
|
ustring type;
|
|
|
|
ustring convert_from;
|
|
|
|
ustring convert_to;
|
|
|
|
|
|
|
|
static ShaderEnum type_enum;
|
|
|
|
static ShaderEnum convert_space_enum;
|
|
|
|
};
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
class BumpNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(BumpNode)
|
2014-04-03 20:04:39 +00:00
|
|
|
bool has_spatial_varying() { return true; }
|
|
|
|
|
2013-05-10 16:57:17 +00:00
|
|
|
bool invert;
|
2011-04-27 11:58:34 +00:00
|
|
|
};
|
|
|
|
|
2012-03-26 12:45:14 +00:00
|
|
|
class RGBCurvesNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(RGBCurvesNode)
|
|
|
|
float4 curves[RAMP_TABLE_SIZE];
|
|
|
|
};
|
|
|
|
|
2012-12-11 14:39:37 +00:00
|
|
|
class VectorCurvesNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(VectorCurvesNode)
|
|
|
|
float4 curves[RAMP_TABLE_SIZE];
|
|
|
|
};
|
|
|
|
|
2012-03-26 12:45:14 +00:00
|
|
|
class RGBRampNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(RGBRampNode)
|
|
|
|
float4 ramp[RAMP_TABLE_SIZE];
|
2013-05-10 11:44:24 +00:00
|
|
|
bool interpolate;
|
2012-03-26 12:45:14 +00:00
|
|
|
};
|
|
|
|
|
2012-10-10 15:56:43 +00:00
|
|
|
class SetNormalNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(SetNormalNode)
|
|
|
|
};
|
|
|
|
|
2012-11-03 14:32:35 +00:00
|
|
|
class OSLScriptNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(OSLScriptNode)
|
2014-04-03 20:04:39 +00:00
|
|
|
|
|
|
|
/* ideally we could beter detect this, but we can't query this now */
|
|
|
|
bool has_spatial_varying() { return true; }
|
|
|
|
|
2012-11-03 14:32:35 +00:00
|
|
|
string filepath;
|
|
|
|
string bytecode_hash;
|
|
|
|
|
|
|
|
/* ShaderInput/ShaderOutput only stores a shallow string copy (const char *)!
|
|
|
|
* The actual socket names have to be stored externally to avoid memory errors. */
|
|
|
|
vector<ustring> input_names;
|
|
|
|
vector<ustring> output_names;
|
|
|
|
};
|
|
|
|
|
2012-11-06 19:59:02 +00:00
|
|
|
class NormalMapNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(NormalMapNode)
|
2013-12-31 16:30:34 +00:00
|
|
|
void attributes(Shader *shader, AttributeRequestSet *attributes);
|
2014-04-03 20:04:39 +00:00
|
|
|
bool has_spatial_varying() { return true; }
|
2012-11-06 19:59:02 +00:00
|
|
|
|
|
|
|
ustring space;
|
|
|
|
static ShaderEnum space_enum;
|
|
|
|
|
|
|
|
ustring attribute;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TangentNode : public ShaderNode {
|
|
|
|
public:
|
|
|
|
SHADER_NODE_CLASS(TangentNode)
|
2013-12-31 16:30:34 +00:00
|
|
|
void attributes(Shader *shader, AttributeRequestSet *attributes);
|
2014-04-03 20:04:39 +00:00
|
|
|
bool has_spatial_varying() { return true; }
|
2012-11-06 19:59:02 +00:00
|
|
|
|
|
|
|
ustring direction_type;
|
|
|
|
static ShaderEnum direction_type_enum;
|
|
|
|
|
|
|
|
ustring axis;
|
|
|
|
static ShaderEnum axis_enum;
|
|
|
|
|
|
|
|
ustring attribute;
|
|
|
|
};
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
CCL_NAMESPACE_END
|
|
|
|
|
|
|
|
#endif /* __NODES_H__ */
|
|
|
|
|