diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-01-21 13:05:05 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-01-21 13:05:05 +0400 |
commit | 04affbe80eeddd0cd9a47b888cce3f9b26dbbe04 (patch) | |
tree | 88894040277fd7bfc58fb4b1933d201b5069238a /source/blender/render/extern/include/RE_shader_ext.h | |
parent | 86991fbcb0e8a1c65acff5aed85ce55f8b108baa (diff) |
Support normalized displacement maps in cases maximal distance is not set
This will calculate maximal distance automatically and normalize displacement
to it. Before this change normalization will not happen at all in cases max
distance is not set manually.
This affects on "regular" baker only, there are still some fixes to come for
multiresolution baker, but that could be solved separately.
Diffstat (limited to 'source/blender/render/extern/include/RE_shader_ext.h')
-rw-r--r-- | source/blender/render/extern/include/RE_shader_ext.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/render/extern/include/RE_shader_ext.h b/source/blender/render/extern/include/RE_shader_ext.h index 4b3e7c2bc42..8818aa67c32 100644 --- a/source/blender/render/extern/include/RE_shader_ext.h +++ b/source/blender/render/extern/include/RE_shader_ext.h @@ -184,6 +184,11 @@ typedef struct ShadeInput { } ShadeInput; +typedef struct BakeImBufuserData { + float *displacement_buffer; + float displacement_min, displacement_max; + char *mask_buffer; +} BakeImBufuserData; /* node shaders... */ struct Tex; @@ -207,6 +212,7 @@ struct Object; int RE_bake_shade_all_selected(struct Render *re, int type, struct Object *actob, short *do_update, float *progress); struct Image *RE_bake_shade_get_image(void); void RE_bake_ibuf_filter(struct ImBuf *ibuf, char *mask, const int filter); +void RE_bake_ibuf_normalize_displacement(struct ImBuf *ibuf, float *displacement, char *mask, float global_displacement_min, float global_displacement_max); #define BAKE_RESULT_OK 0 #define BAKE_RESULT_NO_OBJECTS 1 |