This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/draw/engines/workbench/workbench_studiolight.c
Jeroen Bakker d3c4248946 Workbench: StudioLight HDRI's
The Studio lights are now loaded from disk. The location is
`datafiles/studiolights` they need to be JPG for now. JPG cannot store
HDRI color range but they are clamped inside the Workbench
engine for speed reason. I didn't select JP2K as it might not be
enabled.

Users can add upto 20 HDRI files. This limitation is inside the
RNA_space.c Currently the icons are calculated when you first open the
selection box for the HDRI's. We could add them to a background
rendering later.

I added 2 test files a sky texture rendered in Cycles and an HDRI from
cloud.blender.org.
2018-05-11 17:02:13 +02:00

41 lines
1.5 KiB
C

/*
* Copyright 2016, Blender Foundation.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Contributor(s): Blender Institute
*
*/
/** \file workbench_studiolight.c
* \ingroup draw_engine
*/
#include "BKE_studiolight.h"
#include "DRW_engine.h"
#include "workbench_private.h"
#include "BLI_math.h"
void studiolight_update_world(StudioLight *sl, WORKBENCH_UBO_World *wd)
{
copy_v3_v3(wd->diffuse_light_x_pos, sl->diffuse_light[STUDIOLIGHT_X_POS]);
copy_v3_v3(wd->diffuse_light_x_neg, sl->diffuse_light[STUDIOLIGHT_X_NEG]);
copy_v3_v3(wd->diffuse_light_y_pos, sl->diffuse_light[STUDIOLIGHT_Y_POS]);
copy_v3_v3(wd->diffuse_light_y_neg, sl->diffuse_light[STUDIOLIGHT_Y_NEG]);
copy_v3_v3(wd->diffuse_light_z_pos, sl->diffuse_light[STUDIOLIGHT_Z_POS]);
copy_v3_v3(wd->diffuse_light_z_neg, sl->diffuse_light[STUDIOLIGHT_Z_NEG]);
}