Age | Commit message (Collapse) | Author |
|
Needed for clan-format not to wrap onto one line.
|
|
BF-admins agree to remove header information that isn't useful,
to reduce noise.
- BEGIN/END license blocks
Developers should add non license comments as separate comment blocks.
No need for separator text.
- Contributors
This is often invalid, outdated or misleading
especially when splitting files.
It's more useful to git-blame to find out who has developed the code.
See P901 for script to perform these edits.
|
|
|
|
- Remove pathlib use
(was converting to/from string with no real advantage).
- Use user_resource(..., create=True) to ensure the path exists.
- Pass full path to BKE_studiolight_create, don't add extension after.
- Fix 'sl' filtering glob and move from ui code to operator.
- Fix string copy length.
|
|
|
|
|
|
Reviewers: brecht
Maniphest Tasks: T58104
Differential Revision: https://developer.blender.org/D4028
|
|
There was a bug due to non-aligned struct in the DNA that prevented us
to increase the size of the userdef light array.
Since the studio lights are now presets and stored in external files,
there is no need to keep backward compatibility with theses lights.
Remove the old array and create a new one.
Add blue tint light for specular.
|
|
|
|
This changes a bit how the userprefs solid lights works. They are not
visible until enabling the "Edit Solid Light" checkbox. Once enabled the
current studiolight used for solid mode will be overwritten.
Once the lighting settings are tweaked, the user can click the
"Save as Studio light" button to save the current settings.
This makes it easy to create new lighting without messing the other
presets.
The studio lights are stored as ASCII files on the disk using a dead
simple custom format.
The UI/UX is not perfect and will be improved in other commits.
Also includes:
* Separate LookDev HDRI selection from Solid Lights
* Hide LookDev HDRIs from the Solid Lights selection list
|
|
|
|
|
|
|
|
|
|
This makes the lighting a bit more diffuse but don't produce negative
values.
Add a bias of 1.5f to make the lighting a bit more directionnal.
The implementation is based on:
https://github.com/kayru/Probulator/blob/master/Source/Probulator/SphericalHarmonics.h#L136
which is derived from:
http://www.geomerics.com/wp-content/uploads/2015/08/CEDEC_Geomerics_ReconstructingDiffuseLighting1.pdf
The shader implementation is optimized and has the same runtime cost
as previous method:
* no sh eval : 0.13ms
* prev sh eval : 0.14ms
* new sh eval : 0.22ms
* new sh eval opti : 0.14ms
|
|
* Less Lengthy enum/macro names.
* Optimize computation of Spherical Harmonics.
* Reduce radiance cubemap size a bit. Higher resolution is not necessary.
* Remove STUDIOLIGHT_LIGHT_DIRECTION_CALCULATED (was not used).
* Do windowing on each component separately instead of using luminance.
* Use ITER_PIXELS to iterate on each pixels, using pixel center coords.
* Remove gpu_matcap_3components as it is only needed when creating the gputex.
* Fix a lot of confusion in axis denomination/swizzle.
These changes should not affect functionallity.
|
|
`STUDIOLIGHT_SPHERICAL_HARMONICS_WINDOWING` was commented.
|
|
This option is causing the texture to become full of nan(ind)s.
I don't know how it worked before.
Until this is resolved, this feature (which improves the quality of LOOKDEV's irradiance texture) will be disabled.
|
|
|
|
|
|
- Texture creation now requires explicit data type.
- GPU_texture_add_mipmap enable explicit mipmap upload.
- GPU_texture_get_mipmap_size can be used to get the size of a mipmap level
of an existing GPUTexture
- GPU_texture_read let you read back data from a gpu texture.
|
|
|
|
Added a compile directive in order to test SH4 in stead of SH2Win.
For now I disabled SH4, it is a bit more clear, but has a small
performance impact. Will check later for a better approach
|
|
|
|
In stead of a single refresh function that re-init the whole system. The
API now supports adding and removing. Which will be much faster and less
flickering of missing icons when adding/removing lights
|
|
It does not make much sense for the other levels
|
|
Apply Windowing on the Spherical Harmonics result. This would lead to
better results.
|
|
|
|
|
|
|
|
The calculation of the irradiance buffer was slow. Now it is only
calculated when it is being used (background_alpha > 0.0)
this solves the freeze when switching to LookDev mode.
Also changed the default calculation to use the Spherical Harmonics
calculation. This is able to generate the irradiance buffer fast, but is
less accurate. As the irradiance buffer is only used for visual
guidance speed is more important than accuracy.
Added compile directive to switch between the implementations.
(see STUDIOLIGHT_IRRADIANCE_METHOD)
Disabled caching the irradiance buffer when
STUDIOLIGHT_IRRADIANCE_METHOD_SPHERICAL_HARMONICS is used as it is not
needed.
|
|
Compile time option to reduce the level of the SH
|
|
- Orientation of the cubemap were not conform cycles and eevee
- one side of the cubemap was flipped, so one side was overlit and the
other side was to dark.
|
|
|
|
Happened when deleting many studiolights at the same time when the
previews were still beging calculated in the background.
Added a free function callback that is filled when the preview is being
generated. This free function will then kill the preview job
This patch also removes icons that are not valid anymore so the user
cannot accidentally render an icon where the studiolight is invalid.
In the end we should use a add/remove function in the studiolight as
currently icons are recalculated too much.
|
|
This is a temp fix for a better system.
Currently the studiolights can be referenced by a WM_job and being freed
via the API. This can happen when removing a studiolight via the
interface.
As the studiolight has no relation with the job, it is hard to detect if
it is still being used. I tried with a Mutex and a Thread Queue but they
were failing.
So the current temp fix is to keep the studiolights in memory until you
close blender. This Must be fixed ASAP! I added this fix so normal cases
can workish.
|
|
|
|
- the result of the SH2-coeffiecients are stored in a bin file (3*9
floats). As the file is a local file we do not care about the
architecture.
- solved issue that also for internal lights the irradiance file were
stored. We don't want that as it could be in a not accessible location
|
|
|
|
|
|
- implemented Spherical Harmonics L2 for diffuse shading.
TODO: caching the precalculated harmonics so it won't take soo long to
open the popover
|
|
|
|
|
|
|
|
|
|
Use same antialiasing method as the matcaps and fix the normal computation.
|
|
|
|
|
|
|
|
|