Cycles: Support texture coordinate from another object
This is the same as blender internal's texture mapping from another object, so this way it's possible to control texture space of one object by another. Quite straightforward change apart from the workaround for the stupidness of the dependency graph. Now shader has flag telling that it depends on object transform. This is the simplest way to know which shaders needs to be tagged for update when object changes. This might give some false-positive tags now but reducing them should not be priority for Cycles and rather be a priority to bring new dependency graph. Also GLSL preview does not support using other object for mapping. This is actually correct for BI shading as well and to be addressed as a part of general GLSL viewport improvements since it's not really clear how to support this in GLSL. Reviewers: brecht, juicyfruit Subscribers: eyecandy, venomgfx Differential Revision: https://developer.blender.org/D1021
This commit is contained in:
@@ -21,7 +21,9 @@ shader node_texture_coordinate(
|
||||
int is_background = 0,
|
||||
int is_volume = 0,
|
||||
int from_dupli = 0,
|
||||
int use_transform = 0,
|
||||
string bump_offset = "center",
|
||||
matrix object_itfm = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
|
||||
|
||||
output point Generated = point(0.0, 0.0, 0.0),
|
||||
output point UV = point(0.0, 0.0, 0.0),
|
||||
@@ -60,7 +62,12 @@ shader node_texture_coordinate(
|
||||
getattribute("geom:uv", UV);
|
||||
}
|
||||
|
||||
Object = transform("object", P);
|
||||
if (use_transform) {
|
||||
Object = transform(object_itfm, P);
|
||||
}
|
||||
else {
|
||||
Object = transform("object", P);
|
||||
}
|
||||
Camera = transform("camera", P);
|
||||
Window = transform("NDC", P);
|
||||
Normal = transform("world", "object", NormalIn);
|
||||
|
Reference in New Issue
Block a user