Cycles: Automatically detect HDRI resolution by default and use non-square sampling map
authorLukas Stockner <lukas.stockner@freenet.de>
Thu, 14 Jun 2018 14:18:34 +0000 (16:18 +0200)
committerLukas Stockner <lukas.stockner@freenet.de>
Thu, 14 Jun 2018 20:07:07 +0000 (22:07 +0200)
commit716e138a1b8cb81e13f7da2da5d16763d868743a
tree3aed0b6a0ab447071f9f4ba802cdc2f080b54a27
parentfd19069999e3655206ccf21dc851801a325dea5d
Cycles: Automatically detect HDRI resolution by default and use non-square sampling map

The automatic mode checks all Enviroment Texture nodes and picks the largest image's resolution.
If there are no Enviroment Textures, it just uses the old default.

Also, the sampling map now isn't limited to square shapes. The automatic detection uses the exact image size,
the manual UI option now halves the value to get the height.

A default aspect ratio of 2:1 makes sense since this is what most HDRIs use.

Reviewers: brecht, sergey

Differential Revision: https://developer.blender.org/D3477
intern/cycles/blender/addon/properties.py
intern/cycles/blender/addon/ui.py
intern/cycles/blender/addon/version_update.py
intern/cycles/blender/blender_object.cpp
intern/cycles/kernel/kernel_emission.h
intern/cycles/kernel/kernel_light.h
intern/cycles/kernel/kernel_types.h
intern/cycles/render/image.cpp
intern/cycles/render/image.h
intern/cycles/render/light.cpp