Cleanup: spelling in comments
This commit is contained in:
@@ -76,7 +76,7 @@ bool device_oneapi_init()
|
|||||||
/* NOTE(@nsirgien): we need to enable JIT cache from here and
|
/* NOTE(@nsirgien): we need to enable JIT cache from here and
|
||||||
* right now this cache policy is controlled by env. variables. */
|
* right now this cache policy is controlled by env. variables. */
|
||||||
/* NOTE(hallade) we also disable use of copy engine as it
|
/* NOTE(hallade) we also disable use of copy engine as it
|
||||||
* improves stability as of intel/llvm sycl-nightly/20220529.
|
* improves stability as of intel/LLVM SYCL-nightly/20220529.
|
||||||
* All these env variable can be set beforehand by end-users and
|
* All these env variable can be set beforehand by end-users and
|
||||||
* will in that case -not- be overwritten. */
|
* will in that case -not- be overwritten. */
|
||||||
# ifdef _WIN32
|
# ifdef _WIN32
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ OneapiDevice::OneapiDevice(const DeviceInfo &info,
|
|||||||
|
|
||||||
oneapi_dll_.oneapi_set_error_cb(queue_error_cb, &oneapi_error_string_);
|
oneapi_dll_.oneapi_set_error_cb(queue_error_cb, &oneapi_error_string_);
|
||||||
|
|
||||||
/* Oneapi calls should be initialised on this moment. */
|
/* OneAPI calls should be initialized on this moment. */
|
||||||
assert(oneapi_dll_.oneapi_create_queue != nullptr);
|
assert(oneapi_dll_.oneapi_create_queue != nullptr);
|
||||||
|
|
||||||
bool is_finished_ok = oneapi_dll_.oneapi_create_queue(device_queue_, info.num);
|
bool is_finished_ok = oneapi_dll_.oneapi_create_queue(device_queue_, info.num);
|
||||||
@@ -93,7 +93,7 @@ BVHLayoutMask OneapiDevice::get_bvh_layout_mask() const
|
|||||||
bool OneapiDevice::load_kernels(const uint requested_features)
|
bool OneapiDevice::load_kernels(const uint requested_features)
|
||||||
{
|
{
|
||||||
assert(device_queue_);
|
assert(device_queue_);
|
||||||
/* NOTE(@nsirgien): oneAPI can support compilation of kernel code with sertain feature set
|
/* NOTE(@nsirgien): oneAPI can support compilation of kernel code with certain feature set
|
||||||
* with specialization constants, but it hasn't been implemented yet. */
|
* with specialization constants, but it hasn't been implemented yet. */
|
||||||
(void)requested_features;
|
(void)requested_features;
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
/* Include kernel header to get access to sycl-specific types, like SyclQueue and
|
/* Include kernel header to get access to SYCL-specific types, like SyclQueue and
|
||||||
* OneAPIDeviceIteratorCallback. */
|
* OneAPIDeviceIteratorCallback. */
|
||||||
#include "kernel/device/oneapi/kernel.h"
|
#include "kernel/device/oneapi/kernel.h"
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ CCL_NAMESPACE_BEGIN
|
|||||||
class OneapiDevice;
|
class OneapiDevice;
|
||||||
class device_memory;
|
class device_memory;
|
||||||
|
|
||||||
/* Base class for Oneapi queues. */
|
/* Base class for OneAPI queues. */
|
||||||
class OneapiDeviceQueue : public DeviceQueue {
|
class OneapiDeviceQueue : public DeviceQueue {
|
||||||
public:
|
public:
|
||||||
explicit OneapiDeviceQueue(OneapiDevice *device);
|
explicit OneapiDeviceQueue(OneapiDevice *device);
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ ccl_always_inline float3 make_float3(float x)
|
|||||||
#include "util/types.h"
|
#include "util/types.h"
|
||||||
|
|
||||||
/* NOTE(@nsirgien): Declaring these functions after types headers is very important because they
|
/* NOTE(@nsirgien): Declaring these functions after types headers is very important because they
|
||||||
* include oneAPI headers, which transitively include math.h headers which will cause redefintions
|
* include oneAPI headers, which transitively include math.h headers which will cause redefinitions
|
||||||
* of the math defines because math.h also uses them and having them defined before math.h include
|
* of the math defines because math.h also uses them and having them defined before math.h include
|
||||||
* is actually UB. */
|
* is actually UB. */
|
||||||
/* Use fast math functions - get them from sycl::native namespace for native math function
|
/* Use fast math functions - get them from sycl::native namespace for native math function
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ DLL_INTERFACE_CALL(oneapi_usm_memset,
|
|||||||
DLL_INTERFACE_CALL(oneapi_run_test_kernel, bool, SyclQueue *queue)
|
DLL_INTERFACE_CALL(oneapi_run_test_kernel, bool, SyclQueue *queue)
|
||||||
|
|
||||||
/* Operation with Kernel globals structure - map of global/constant allocation - filled before
|
/* Operation with Kernel globals structure - map of global/constant allocation - filled before
|
||||||
* render/kernel execution As we don't know in cycles sizeof this - Cycles will manage just as
|
* render/kernel execution As we don't know in cycles `sizeof` this - Cycles will manage just as
|
||||||
* pointer. */
|
* pointer. */
|
||||||
DLL_INTERFACE_CALL(oneapi_kernel_globals_size, bool, SyclQueue *queue, size_t &kernel_global_size)
|
DLL_INTERFACE_CALL(oneapi_kernel_globals_size, bool, SyclQueue *queue, size_t &kernel_global_size)
|
||||||
DLL_INTERFACE_CALL(oneapi_set_global_memory,
|
DLL_INTERFACE_CALL(oneapi_set_global_memory,
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ template<typename T> struct NanoVDBInterpolator {
|
|||||||
int nix, niy, niz;
|
int nix, niy, niz;
|
||||||
int pix, piy, piz;
|
int pix, piy, piz;
|
||||||
int nnix, nniy, nniz;
|
int nnix, nniy, nniz;
|
||||||
/* Tricubic b-spline interpolation. */
|
/* Tri-cubic b-spline interpolation. */
|
||||||
const float tx = svm_image_texture_frac(x - 0.5f, &ix);
|
const float tx = svm_image_texture_frac(x - 0.5f, &ix);
|
||||||
const float ty = svm_image_texture_frac(y - 0.5f, &iy);
|
const float ty = svm_image_texture_frac(y - 0.5f, &iy);
|
||||||
const float tz = svm_image_texture_frac(z - 0.5f, &iz);
|
const float tz = svm_image_texture_frac(z - 0.5f, &iz);
|
||||||
@@ -355,7 +355,7 @@ ccl_device float4 kernel_tex_image_interp_3d(KernelGlobals, int id, float3 P, in
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* Tricubic interpolation. */
|
/* Tri-cubic interpolation. */
|
||||||
int ix, iy, iz;
|
int ix, iy, iz;
|
||||||
float tx = svm_image_texture_frac(x - 0.5f, &ix);
|
float tx = svm_image_texture_frac(x - 0.5f, &ix);
|
||||||
float ty = svm_image_texture_frac(y - 0.5f, &iy);
|
float ty = svm_image_texture_frac(y - 0.5f, &iy);
|
||||||
|
|||||||
@@ -328,8 +328,8 @@ bool oneapi_enqueue_kernel(KernelContext *kernel_context,
|
|||||||
int num_states = *((int *)(args[0]));
|
int num_states = *((int *)(args[0]));
|
||||||
/* Round up to the next work-group. */
|
/* Round up to the next work-group. */
|
||||||
size_t groups_count = (num_states + local_size - 1) / local_size;
|
size_t groups_count = (num_states + local_size - 1) / local_size;
|
||||||
/* NOTE(@nsirgien): As for now non-uniform workgroups don't work on most oneAPI devices, we
|
/* NOTE(@nsirgien): As for now non-uniform work-groups don't work on most oneAPI devices,
|
||||||
* extend work size to fit uniformity requirements. */
|
* we extend work size to fit uniformity requirements. */
|
||||||
global_size = groups_count * local_size;
|
global_size = groups_count * local_size;
|
||||||
|
|
||||||
# ifdef WITH_ONEAPI_SYCL_HOST_ENABLED
|
# ifdef WITH_ONEAPI_SYCL_HOST_ENABLED
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
/* Some macro magic to generate templates for kernel arguments.
|
/* Some macro magic to generate templates for kernel arguments.
|
||||||
The resulting oneapi_call() template allows to call a SYCL/C++ kernel
|
* The resulting oneapi_call() template allows to call a SYCL/C++ kernel
|
||||||
with typed arguments by only giving it a void **args as given by Cycles.
|
* with typed arguments by only giving it a void `**args` as given by Cycles.
|
||||||
The template will automatically cast from void* to the expectd type.
|
* The template will automatically cast from void* to the expected type. */
|
||||||
*/
|
|
||||||
|
|
||||||
/* When expanded by the preprocessor, the generated templates will look like this example: */
|
/* When expanded by the preprocessor, the generated templates will look like this example: */
|
||||||
#if 0
|
#if 0
|
||||||
|
|||||||
@@ -1710,12 +1710,12 @@ bool OSLRenderServices::trace(TraceOpt &options,
|
|||||||
|
|
||||||
const KernelGlobalsCPU *kg = sd->osl_globals;
|
const KernelGlobalsCPU *kg = sd->osl_globals;
|
||||||
|
|
||||||
/* Can't raytrace from shaders like displacement, before BVH exists. */
|
/* Can't ray-trace from shaders like displacement, before BVH exists. */
|
||||||
if (kernel_data.bvh.bvh_layout == BVH_LAYOUT_NONE) {
|
if (kernel_data.bvh.bvh_layout == BVH_LAYOUT_NONE) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Raytrace, leaving out shadow opaque to avoid early exit. */
|
/* Ray-trace, leaving out shadow opaque to avoid early exit. */
|
||||||
uint visibility = PATH_RAY_ALL_VISIBILITY - PATH_RAY_SHADOW_OPAQUE;
|
uint visibility = PATH_RAY_ALL_VISIBILITY - PATH_RAY_SHADOW_OPAQUE;
|
||||||
tracedata->hit = scene_intersect(kg, &ray, visibility, &tracedata->isect);
|
tracedata->hit = scene_intersect(kg, &ray, visibility, &tracedata->isect);
|
||||||
return tracedata->hit;
|
return tracedata->hit;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ ccl_device float svm_ao(
|
|||||||
return 1.0f;
|
return 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Can't raytrace from shaders like displacement, before BVH exists. */
|
/* Can't ray-trace from shaders like displacement, before BVH exists. */
|
||||||
if (kernel_data.bvh.bvh_layout == BVH_LAYOUT_NONE) {
|
if (kernel_data.bvh.bvh_layout == BVH_LAYOUT_NONE) {
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ ccl_device float3 svm_bevel(
|
|||||||
return sd->N;
|
return sd->N;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Can't raytrace from shaders like displacement, before BVH exists. */
|
/* Can't ray-trace from shaders like displacement, before BVH exists. */
|
||||||
if (kernel_data.bvh.bvh_layout == BVH_LAYOUT_NONE) {
|
if (kernel_data.bvh.bvh_layout == BVH_LAYOUT_NONE) {
|
||||||
return sd->N;
|
return sd->N;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -395,7 +395,7 @@ ccl_device_noinline int svm_node_closure_bsdf(KernelGlobals kg,
|
|||||||
if (kernel_data.integrator.caustics_refractive || (path_flag & PATH_RAY_DIFFUSE) == 0)
|
if (kernel_data.integrator.caustics_refractive || (path_flag & PATH_RAY_DIFFUSE) == 0)
|
||||||
# endif
|
# endif
|
||||||
{
|
{
|
||||||
/* This is to prevent mnee from receiving a null bsdf. */
|
/* This is to prevent MNEE from receiving a null BSDF. */
|
||||||
float refraction_fresnel = fmaxf(0.0001f, 1.0f - fresnel);
|
float refraction_fresnel = fmaxf(0.0001f, 1.0f - fresnel);
|
||||||
ccl_private MicrofacetBsdf *bsdf = (ccl_private MicrofacetBsdf *)bsdf_alloc(
|
ccl_private MicrofacetBsdf *bsdf = (ccl_private MicrofacetBsdf *)bsdf_alloc(
|
||||||
sd, sizeof(MicrofacetBsdf), base_color * glass_weight * refraction_fresnel);
|
sd, sizeof(MicrofacetBsdf), base_color * glass_weight * refraction_fresnel);
|
||||||
@@ -676,7 +676,7 @@ ccl_device_noinline int svm_node_closure_bsdf(KernelGlobals kg,
|
|||||||
if (kernel_data.integrator.caustics_refractive || (path_flag & PATH_RAY_DIFFUSE) == 0)
|
if (kernel_data.integrator.caustics_refractive || (path_flag & PATH_RAY_DIFFUSE) == 0)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
/* This is to prevent mnee from receiving a null bsdf. */
|
/* This is to prevent MNEE from receiving a null BSDF. */
|
||||||
float refraction_fresnel = fmaxf(0.0001f, 1.0f - fresnel);
|
float refraction_fresnel = fmaxf(0.0001f, 1.0f - fresnel);
|
||||||
ccl_private MicrofacetBsdf *bsdf = (ccl_private MicrofacetBsdf *)bsdf_alloc(
|
ccl_private MicrofacetBsdf *bsdf = (ccl_private MicrofacetBsdf *)bsdf_alloc(
|
||||||
sd, sizeof(MicrofacetBsdf), weight * refraction_fresnel);
|
sd, sizeof(MicrofacetBsdf), weight * refraction_fresnel);
|
||||||
|
|||||||
@@ -499,9 +499,9 @@ void Scene::update_kernel_features()
|
|||||||
kernel_features |= KERNEL_FEATURE_CAMERA_MOTION;
|
kernel_features |= KERNEL_FEATURE_CAMERA_MOTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Figure out whether the scene will use shader raytrace we need at least
|
/* Figure out whether the scene will use shader ray-trace we need at least
|
||||||
* one caustic light, one caustic caster and one caustic receiver to use
|
* one caustic light, one caustic caster and one caustic receiver to use
|
||||||
* and enable the mnee code path. */
|
* and enable the MNEE code path. */
|
||||||
bool has_caustics_receiver = false;
|
bool has_caustics_receiver = false;
|
||||||
bool has_caustics_caster = false;
|
bool has_caustics_caster = false;
|
||||||
bool has_caustics_light = false;
|
bool has_caustics_light = false;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ Version history:
|
|||||||
|
|
||||||
1.4a February 22nd, 2013
|
1.4a February 22nd, 2013
|
||||||
Removed unnecessary and counter-intuitive solar radius parameters
|
Removed unnecessary and counter-intuitive solar radius parameters
|
||||||
from the interface of the colourspace sky dome initialisation functions.
|
from the interface of the colourspace sky dome initialization functions.
|
||||||
|
|
||||||
1.4 February 11th, 2013
|
1.4 February 11th, 2013
|
||||||
Fixed a bug which caused the relative brightness of the solar disc
|
Fixed a bug which caused the relative brightness of the solar disc
|
||||||
@@ -76,7 +76,7 @@ Usage information:
|
|||||||
==================
|
==================
|
||||||
|
|
||||||
|
|
||||||
Model initialisation
|
Model initialization
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
A separate ArHosekSkyModelState has to be maintained for each spectral
|
A separate ArHosekSkyModelState has to be maintained for each spectral
|
||||||
@@ -101,12 +101,12 @@ is given in radians.
|
|||||||
solarElevation
|
solarElevation
|
||||||
);
|
);
|
||||||
|
|
||||||
Note that starting with version 1.3, there is also a second initialisation
|
Note that starting with version 1.3, there is also a second initialization
|
||||||
function which generates skydome states for different solar emission spectra
|
function which generates skydome states for different solar emission spectra
|
||||||
and solar radii: 'arhosekskymodelstate_alienworld_alloc_init()'.
|
and solar radii: 'arhosekskymodelstate_alienworld_alloc_init()'.
|
||||||
|
|
||||||
See the notes about the "Alien World" functionality provided further down for a
|
See the notes about the "Alien World" functionality provided further down for a
|
||||||
discussion of the usefulness and limits of that second initialisation function.
|
discussion of the usefulness and limits of that second initialization function.
|
||||||
Sky model states that have been initialized with either function behave in a
|
Sky model states that have been initialized with either function behave in a
|
||||||
completely identical fashion during use and cleanup.
|
completely identical fashion during use and cleanup.
|
||||||
|
|
||||||
@@ -236,7 +236,7 @@ CAVEAT #3: you have to provide a value for the solar intensity of the star
|
|||||||
fairly different in size from it, to still provide a reasonable and
|
fairly different in size from it, to still provide a reasonable and
|
||||||
inhabitable amount of irradiance. Red stars will need to be much
|
inhabitable amount of irradiance. Red stars will need to be much
|
||||||
larger than our sun, while white or blue stars will have to be
|
larger than our sun, while white or blue stars will have to be
|
||||||
comparatively tiny. The initialisation function handles this and
|
comparatively tiny. The initialization function handles this and
|
||||||
computes a plausible solar radius for a given emission spectrum. In
|
computes a plausible solar radius for a given emission spectrum. In
|
||||||
terms of absolute radiometric values, you should probably not stray
|
terms of absolute radiometric values, you should probably not stray
|
||||||
all too far from a solar intensity value of 1.0.
|
all too far from a solar intensity value of 1.0.
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ Version history:
|
|||||||
|
|
||||||
1.4a February 22nd, 2013
|
1.4a February 22nd, 2013
|
||||||
Removed unnecessary and counter-intuitive solar radius parameters
|
Removed unnecessary and counter-intuitive solar radius parameters
|
||||||
from the interface of the colourspace sky dome initialisation functions.
|
from the interface of the color-space sky dome initialization functions.
|
||||||
|
|
||||||
1.4 February 11th, 2013
|
1.4 February 11th, 2013
|
||||||
Fixed a bug which caused the relative brightness of the solar disc
|
Fixed a bug which caused the relative brightness of the solar disc
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ Version history:
|
|||||||
|
|
||||||
1.4a February 22nd, 2013
|
1.4a February 22nd, 2013
|
||||||
Removed unnecessary and counter-intuitive solar radius parameters
|
Removed unnecessary and counter-intuitive solar radius parameters
|
||||||
from the interface of the colourspace sky dome initialisation functions.
|
from the interface of the color-space sky dome initialization functions.
|
||||||
|
|
||||||
1.4 February 11th, 2013
|
1.4 February 11th, 2013
|
||||||
Fixed a bug which caused the relative brightness of the solar disc
|
Fixed a bug which caused the relative brightness of the solar disc
|
||||||
|
|||||||
@@ -2552,7 +2552,7 @@ static void dynamic_paint_find_island_border(const DynamicPaintCreateUVSurfaceDa
|
|||||||
const int vert1 = mloop[loop_idx[(edge_idx + 1) % 3]].v;
|
const int vert1 = mloop[loop_idx[(edge_idx + 1) % 3]].v;
|
||||||
|
|
||||||
/* Use a pre-computed vert-to-looptri mapping,
|
/* Use a pre-computed vert-to-looptri mapping,
|
||||||
* speeds up things a lot compared to looping over all loopti. */
|
* speeds up things a lot compared to looping over all looptri. */
|
||||||
const MeshElemMap *map = &bdata->vert_to_looptri_map[vert0];
|
const MeshElemMap *map = &bdata->vert_to_looptri_map[vert0];
|
||||||
|
|
||||||
bool found_other = false;
|
bool found_other = false;
|
||||||
|
|||||||
@@ -1950,7 +1950,7 @@ void BKE_image_stamp_buf(Scene *scene,
|
|||||||
y -= BUFF_MARGIN_Y * 2;
|
y -= BUFF_MARGIN_Y * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Top left corner, below File, Date, Rendertime */
|
/* Top left corner, below File, Date, Render-time */
|
||||||
if (TEXT_SIZE_CHECK(stamp_data.memory, w, h)) {
|
if (TEXT_SIZE_CHECK(stamp_data.memory, w, h)) {
|
||||||
y -= h;
|
y -= h;
|
||||||
|
|
||||||
@@ -1973,7 +1973,7 @@ void BKE_image_stamp_buf(Scene *scene,
|
|||||||
y -= BUFF_MARGIN_Y * 2;
|
y -= BUFF_MARGIN_Y * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Top left corner, below File, Date, Rendertime, Memory */
|
/* Top left corner, below: File, Date, Render-time, Memory. */
|
||||||
if (TEXT_SIZE_CHECK(stamp_data.hostname, w, h)) {
|
if (TEXT_SIZE_CHECK(stamp_data.hostname, w, h)) {
|
||||||
y -= h;
|
y -= h;
|
||||||
|
|
||||||
@@ -1996,7 +1996,7 @@ void BKE_image_stamp_buf(Scene *scene,
|
|||||||
y -= BUFF_MARGIN_Y * 2;
|
y -= BUFF_MARGIN_Y * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Top left corner, below File, Date, Memory, Rendertime, Hostname */
|
/* Top left corner, below: File, Date, Memory, Render-time, Host-name. */
|
||||||
BLF_enable(mono, BLF_WORD_WRAP);
|
BLF_enable(mono, BLF_WORD_WRAP);
|
||||||
if (TEXT_SIZE_CHECK_WORD_WRAP(stamp_data.note, w, h)) {
|
if (TEXT_SIZE_CHECK_WORD_WRAP(stamp_data.note, w, h)) {
|
||||||
y -= h;
|
y -= h;
|
||||||
|
|||||||
@@ -2296,7 +2296,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
psys->vgroup[PSYS_VG_VEL] = paf->vertgroup_v;
|
psys->vgroup[PSYS_VG_VEL] = paf->vertgroup_v;
|
||||||
psys->vgroup[PSYS_VG_LENGTH] = paf->vertgroup_v;
|
psys->vgroup[PSYS_VG_LENGTH] = paf->vertgroup_v;
|
||||||
|
|
||||||
/* dupliobjects */
|
/* Dupli-objects. */
|
||||||
if (ob->transflag & OB_DUPLIVERTS) {
|
if (ob->transflag & OB_DUPLIVERTS) {
|
||||||
Object *dup = bmain->objects.first;
|
Object *dup = bmain->objects.first;
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ class NodeConverter {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* When a node has no valid data
|
* When a node has no valid data
|
||||||
* \note missing image / group pointer, or missing renderlayer from EXR
|
* \note missing image / group pointer, or missing render-layer from EXR.
|
||||||
*/
|
*/
|
||||||
NodeOperation *set_invalid_output(NodeOutput *output);
|
NodeOperation *set_invalid_output(NodeOutput *output);
|
||||||
|
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ BLI_INLINE int eevee_cryptomatte_pixel_stride(const ViewLayer *view_layer)
|
|||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
/* -------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------- */
|
||||||
/** \name Init Renderpasses
|
/** \name Init Render-Passes
|
||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
void EEVEE_cryptomatte_renderpasses_init(EEVEE_Data *vedata)
|
void EEVEE_cryptomatte_renderpasses_init(EEVEE_Data *vedata)
|
||||||
|
|||||||
@@ -312,12 +312,12 @@ static void eevee_draw_scene(void *vedata)
|
|||||||
/* Volumetrics Resolve Opaque */
|
/* Volumetrics Resolve Opaque */
|
||||||
EEVEE_volumes_resolve(sldata, vedata);
|
EEVEE_volumes_resolve(sldata, vedata);
|
||||||
|
|
||||||
/* Renderpasses */
|
/* Render-passes. */
|
||||||
EEVEE_renderpasses_output_accumulate(sldata, vedata, false);
|
EEVEE_renderpasses_output_accumulate(sldata, vedata, false);
|
||||||
|
|
||||||
/* Transparent */
|
/* Transparent */
|
||||||
/* TODO(fclem): should be its own Frame-buffer.
|
/* TODO(@fclem): should be its own Frame-buffer.
|
||||||
* This is needed because dualsource blending only works with 1 color buffer. */
|
* This is needed because dual-source blending only works with 1 color buffer. */
|
||||||
GPU_framebuffer_texture_attach(fbl->main_color_fb, dtxl->depth, 0, 0);
|
GPU_framebuffer_texture_attach(fbl->main_color_fb, dtxl->depth, 0, 0);
|
||||||
GPU_framebuffer_bind(fbl->main_color_fb);
|
GPU_framebuffer_bind(fbl->main_color_fb);
|
||||||
DRW_draw_pass(psl->transparent_pass);
|
DRW_draw_pass(psl->transparent_pass);
|
||||||
|
|||||||
@@ -1050,7 +1050,7 @@ typedef struct EEVEE_PrivateData {
|
|||||||
float studiolight_glossy_clamp;
|
float studiolight_glossy_clamp;
|
||||||
float studiolight_filter_quality;
|
float studiolight_filter_quality;
|
||||||
|
|
||||||
/* Renderpasses */
|
/* Render-passes */
|
||||||
/* Bitmask containing the active render_passes */
|
/* Bitmask containing the active render_passes */
|
||||||
eViewLayerEEVEEPassType render_passes;
|
eViewLayerEEVEEPassType render_passes;
|
||||||
uint aov_hash;
|
uint aov_hash;
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ void EEVEE_reflection_compute(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *v
|
|||||||
if (((effects->enabled_effects & EFFECT_SSR) != 0) && stl->g_data->valid_double_buffer) {
|
if (((effects->enabled_effects & EFFECT_SSR) != 0) && stl->g_data->valid_double_buffer) {
|
||||||
DRW_stats_group_start("SSR");
|
DRW_stats_group_start("SSR");
|
||||||
|
|
||||||
/* Raytrace. */
|
/* Ray-trace. */
|
||||||
GPU_framebuffer_bind(fbl->screen_tracing_fb);
|
GPU_framebuffer_bind(fbl->screen_tracing_fb);
|
||||||
DRW_draw_pass(psl->ssr_raytrace);
|
DRW_draw_pass(psl->ssr_raytrace);
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ GPU_SHADER_CREATE_INFO(eevee_surf_deferred)
|
|||||||
// .image_out(3, Qualifier::WRITE, GPU_R11F_G11F_B10F, "gbuff_reflection_color")
|
// .image_out(3, Qualifier::WRITE, GPU_R11F_G11F_B10F, "gbuff_reflection_color")
|
||||||
// .image_out(4, Qualifier::WRITE, GPU_RGBA16F, "gbuff_reflection_normal")
|
// .image_out(4, Qualifier::WRITE, GPU_RGBA16F, "gbuff_reflection_normal")
|
||||||
// .image_out(5, Qualifier::WRITE, GPU_R11F_G11F_B10F, "gbuff_emission")
|
// .image_out(5, Qualifier::WRITE, GPU_R11F_G11F_B10F, "gbuff_emission")
|
||||||
/* Renderpasses. */
|
/* Render-passes. */
|
||||||
// .image_out(6, Qualifier::READ_WRITE, GPU_RGBA16F, "rpass_volume_light")
|
// .image_out(6, Qualifier::READ_WRITE, GPU_RGBA16F, "rpass_volume_light")
|
||||||
/* TODO: AOVs maybe? */
|
/* TODO: AOVs maybe? */
|
||||||
.fragment_source("eevee_surf_deferred_frag.glsl")
|
.fragment_source("eevee_surf_deferred_frag.glsl")
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ void OVERLAY_antialiasing_init(OVERLAY_Data *vedata)
|
|||||||
OVERLAY_PrivateData *pd = vedata->stl->pd;
|
OVERLAY_PrivateData *pd = vedata->stl->pd;
|
||||||
DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
|
DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
|
||||||
|
|
||||||
/* Small texture which will have very small impact on rendertime. */
|
/* Small texture which will have very small impact on render-time. */
|
||||||
if (txl->dummy_depth_tx == NULL) {
|
if (txl->dummy_depth_tx == NULL) {
|
||||||
const float pixel[1] = {1.0f};
|
const float pixel[1] = {1.0f};
|
||||||
txl->dummy_depth_tx = DRW_texture_create_2d(1, 1, GPU_DEPTH_COMPONENT24, 0, pixel);
|
txl->dummy_depth_tx = DRW_texture_create_2d(1, 1, GPU_DEPTH_COMPONENT24, 0, pixel);
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ void ED_annotation_draw_ex(
|
|||||||
|
|
||||||
/* ----------- Grease-Pencil AnimEdit API ------------------ */
|
/* ----------- Grease-Pencil AnimEdit API ------------------ */
|
||||||
/**
|
/**
|
||||||
* Loops over the gp-frames for a gp-layer, and applies the given callback.
|
* Loops over the GP-frames for a GP-layer, and applies the given callback.
|
||||||
*/
|
*/
|
||||||
bool ED_gpencil_layer_frames_looper(struct bGPDlayer *gpl,
|
bool ED_gpencil_layer_frames_looper(struct bGPDlayer *gpl,
|
||||||
struct Scene *scene,
|
struct Scene *scene,
|
||||||
|
|||||||
@@ -1005,7 +1005,7 @@ static uiTooltipData *ui_tooltip_data_from_button_or_extra_icon(bContext *C,
|
|||||||
/* this could get its own 'BUT_GET_...' type */
|
/* this could get its own 'BUT_GET_...' type */
|
||||||
|
|
||||||
/* never fails */
|
/* never fails */
|
||||||
/* move ownership (no need for re-alloc) */
|
/* Move ownership (no need for re-allocation). */
|
||||||
if (rnaprop) {
|
if (rnaprop) {
|
||||||
field->text = RNA_path_full_property_py_ex(
|
field->text = RNA_path_full_property_py_ex(
|
||||||
CTX_data_main(C), &but->rnapoin, rnaprop, but->rnaindex, true);
|
CTX_data_main(C), &but->rnapoin, rnaprop, but->rnaindex, true);
|
||||||
|
|||||||
@@ -874,7 +874,7 @@ void MASK_OT_primitive_circle_add(wmOperatorType *ot)
|
|||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
/* -------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------- */
|
||||||
/** \name Primitive Add Suqare Operator
|
/** \name Primitive Add Square Operator
|
||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
static int primitive_square_add_exec(bContext *C, wmOperator *op)
|
static int primitive_square_add_exec(bContext *C, wmOperator *op)
|
||||||
|
|||||||
@@ -617,7 +617,7 @@ static void nla_draw_strip(SpaceNla *snla,
|
|||||||
immUnbindProgram();
|
immUnbindProgram();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* add the relevant text to the cache of text-strings to draw in pixelspace */
|
/** Add the relevant text to the cache of text-strings to draw in pixel-space. */
|
||||||
static void nla_draw_strip_text(AnimData *adt,
|
static void nla_draw_strip_text(AnimData *adt,
|
||||||
NlaTrack *nlt,
|
NlaTrack *nlt,
|
||||||
NlaStrip *strip,
|
NlaStrip *strip,
|
||||||
|
|||||||
@@ -235,7 +235,7 @@ static void nla_main_region_draw(const bContext *C, ARegion *region)
|
|||||||
/* strips and backdrops */
|
/* strips and backdrops */
|
||||||
draw_nla_main_data(&ac, snla, region);
|
draw_nla_main_data(&ac, snla, region);
|
||||||
|
|
||||||
/* text draw cached, in pixelspace now */
|
/* Text draw cached, in pixel-space now. */
|
||||||
UI_view2d_text_cache_draw(region);
|
UI_view2d_text_cache_draw(region);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ typedef struct LineartEdgeSegment {
|
|||||||
|
|
||||||
typedef struct LineartShadowEdge {
|
typedef struct LineartShadowEdge {
|
||||||
struct LineartShadowEdge *next, *prev;
|
struct LineartShadowEdge *next, *prev;
|
||||||
/* Two end points in framebuffer coordinates viewed from the light source. */
|
/* Two end points in frame-buffer coordinates viewed from the light source. */
|
||||||
double fbc1[4], fbc2[4];
|
double fbc1[4], fbc2[4];
|
||||||
double g1[3], g2[3];
|
double g1[3], g2[3];
|
||||||
bool orig1, orig2;
|
bool orig1, orig2;
|
||||||
@@ -129,11 +129,11 @@ typedef struct LineartShadowSegment {
|
|||||||
/* eLineartShadowSegmentFlag */
|
/* eLineartShadowSegmentFlag */
|
||||||
int flag;
|
int flag;
|
||||||
/* The point after which a property of the segment is changed. e.g. shadow mask/target_ref etc.
|
/* The point after which a property of the segment is changed. e.g. shadow mask/target_ref etc.
|
||||||
* Coordinates in NDC during shadow caluclation but transformed to global linear before cutting
|
* Coordinates in NDC during shadow calculation but transformed to global linear before cutting
|
||||||
* onto edges during the loading stage of the "actual" rendering. */
|
* onto edges during the loading stage of the "actual" rendering. */
|
||||||
double ratio;
|
double ratio;
|
||||||
/* Left and right pos, because when casting shadows at some point there will be
|
/* Left and right pos, because when casting shadows at some point there will be
|
||||||
* non-continuous cuts, see #lineart_shadow_edge_cut for detailed explaination. */
|
* non-continuous cuts, see #lineart_shadow_edge_cut for detailed explanation. */
|
||||||
double fbc1[4], fbc2[4];
|
double fbc1[4], fbc2[4];
|
||||||
/* Global position. */
|
/* Global position. */
|
||||||
double g1[4], g2[4];
|
double g1[4], g2[4];
|
||||||
@@ -276,7 +276,7 @@ typedef struct LineartData {
|
|||||||
* calculation is finished. */
|
* calculation is finished. */
|
||||||
LineartStaticMemPool *shadow_data_pool;
|
LineartStaticMemPool *shadow_data_pool;
|
||||||
|
|
||||||
/* Storing shadow edge eln, array, and cuts for shadow information, so it's avaliable when line
|
/* Storing shadow edge eln, array, and cuts for shadow information, so it's available when line
|
||||||
* art runs the second time for occlusion. Either a reference to LineartCache::shadow_data_pool
|
* art runs the second time for occlusion. Either a reference to LineartCache::shadow_data_pool
|
||||||
* (shadow stage) or a reference to LineartData::render_data_pool (final stage). */
|
* (shadow stage) or a reference to LineartData::render_data_pool (final stage). */
|
||||||
LineartStaticMemPool *edge_data_pool;
|
LineartStaticMemPool *edge_data_pool;
|
||||||
@@ -746,8 +746,8 @@ BLI_INLINE int lineart_line_isec_2d_ignore_line2pos(const double a1[2],
|
|||||||
double *r_a_ratio)
|
double *r_a_ratio)
|
||||||
{
|
{
|
||||||
/* The define here is used to check how vector or slope method handles boundary cases. The result
|
/* The define here is used to check how vector or slope method handles boundary cases. The result
|
||||||
* of lim(div->0) and lim(k->0) could both produce some unwanted flickers in line art, the
|
* of `lim(div->0)` and `lim(k->0)` could both produce some unwanted flickers in line art, the
|
||||||
* influence of which is still not fully understood, so keep the switch there for futher
|
* influence of which is still not fully understood, so keep the switch there for further
|
||||||
* investigations. */
|
* investigations. */
|
||||||
#define USE_VECTOR_LINE_INTERSECTION_IGN
|
#define USE_VECTOR_LINE_INTERSECTION_IGN
|
||||||
#ifdef USE_VECTOR_LINE_INTERSECTION_IGN
|
#ifdef USE_VECTOR_LINE_INTERSECTION_IGN
|
||||||
|
|||||||
@@ -3658,7 +3658,7 @@ static LineartData *lineart_create_render_buffer(Scene *scene,
|
|||||||
|
|
||||||
ld->chain_data_pool = &lc->chain_data_pool;
|
ld->chain_data_pool = &lc->chain_data_pool;
|
||||||
|
|
||||||
/* See LineartData::edge_data_pool for explaination. */
|
/* See #LineartData::edge_data_pool for explanation. */
|
||||||
ld->edge_data_pool = &ld->render_data_pool;
|
ld->edge_data_pool = &ld->render_data_pool;
|
||||||
|
|
||||||
BLI_spin_init(&ld->lock_task);
|
BLI_spin_init(&ld->lock_task);
|
||||||
@@ -4494,7 +4494,7 @@ static void lineart_create_edges_from_isec_data(LineartIsecData *d)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We don't care about removing duplicated vert in this method, chaning can handle that,
|
/* We don't care about removing duplicated vert in this method, chaining can handle that,
|
||||||
* and it saves us from using locks and look up tables. */
|
* and it saves us from using locks and look up tables. */
|
||||||
LineartVert *v = lineart_mem_acquire(ld->edge_data_pool, sizeof(LineartVert) * total_lines * 2);
|
LineartVert *v = lineart_mem_acquire(ld->edge_data_pool, sizeof(LineartVert) * total_lines * 2);
|
||||||
LineartEdge *e = lineart_mem_acquire(ld->edge_data_pool, sizeof(LineartEdge) * total_lines);
|
LineartEdge *e = lineart_mem_acquire(ld->edge_data_pool, sizeof(LineartEdge) * total_lines);
|
||||||
@@ -4565,7 +4565,7 @@ static void lineart_create_edges_from_isec_data(LineartIsecData *d)
|
|||||||
}
|
}
|
||||||
else { /* equal priority */
|
else { /* equal priority */
|
||||||
if (ob1 == ob2) {
|
if (ob1 == ob2) {
|
||||||
/* object_ref should be ambigious if intersection lines comes from different objects. */
|
/* object_ref should be ambiguous if intersection lines comes from different objects. */
|
||||||
e->object_ref = ob1;
|
e->object_ref = ob1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5165,7 +5165,7 @@ static void lineart_gpencil_generate(LineartCache *cache,
|
|||||||
}
|
}
|
||||||
if (shaodow_selection) {
|
if (shaodow_selection) {
|
||||||
if (ec->shadow_mask_bits != LRT_SHADOW_MASK_UNDEFINED) {
|
if (ec->shadow_mask_bits != LRT_SHADOW_MASK_UNDEFINED) {
|
||||||
/* TODO(Yiming): Give a behaviour option for how to display undefined shadow info. */
|
/* TODO(@Yiming): Give a behavior option for how to display undefined shadow info. */
|
||||||
if ((shaodow_selection == LRT_SHADOW_FILTER_LIT &&
|
if ((shaodow_selection == LRT_SHADOW_FILTER_LIT &&
|
||||||
(!(ec->shadow_mask_bits & LRT_SHADOW_MASK_LIT))) ||
|
(!(ec->shadow_mask_bits & LRT_SHADOW_MASK_LIT))) ||
|
||||||
(shaodow_selection == LRT_SHADOW_FILTER_SHADED &&
|
(shaodow_selection == LRT_SHADOW_FILTER_SHADED &&
|
||||||
|
|||||||
@@ -193,10 +193,12 @@ static void lineart_shadow_segment_slice_get(double *fb_co_1,
|
|||||||
interp_v3_v3v3_db(r_gloc, gloc_1, gloc_2, ga);
|
interp_v3_v3v3_db(r_gloc, gloc_1, gloc_2, ga);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function tries to get the closest projected segments along two end points.
|
/**
|
||||||
* The x,y of s1, s2 are aligned in framebuffer coordinates, only z,w are different.
|
* This function tries to get the closest projected segments along two end points.
|
||||||
|
* The x,y of s1, s2 are aligned in frame-buffer coordinates, only z,w are different.
|
||||||
* We will get the closest z/w as well as the corresponding global coordinates.
|
* We will get the closest z/w as well as the corresponding global coordinates.
|
||||||
*
|
*
|
||||||
|
* \code{.unparsed}
|
||||||
* (far side)
|
* (far side)
|
||||||
* l-------r [s1] ^
|
* l-------r [s1] ^
|
||||||
* _-r [s2] | In this situation it will essentially return the coordinates of s2.
|
* _-r [s2] | In this situation it will essentially return the coordinates of s2.
|
||||||
@@ -209,9 +211,11 @@ static void lineart_shadow_segment_slice_get(double *fb_co_1,
|
|||||||
* l-----_c`-----r [s1] | and `r_new` will be assigned coordinates of `c`.
|
* l-----_c`-----r [s1] | and `r_new` will be assigned coordinates of `c`.
|
||||||
* _-` |
|
* _-` |
|
||||||
* l-` |
|
* l-` |
|
||||||
|
* \endcode
|
||||||
*
|
*
|
||||||
* Returns true when a new cut (`c`) is needed in the middle, otherwise returns false, and
|
* Returns true when a new cut (`c`) is needed in the middle, otherwise returns false, and
|
||||||
* `*r_new_xxx` are not touched. */
|
* `*r_new_xxx` are not touched.
|
||||||
|
*/
|
||||||
static bool lineart_do_closest_segment(bool is_persp,
|
static bool lineart_do_closest_segment(bool is_persp,
|
||||||
double *s1_fb_co_1,
|
double *s1_fb_co_1,
|
||||||
double *s1_fb_co_2,
|
double *s1_fb_co_2,
|
||||||
@@ -309,7 +313,7 @@ static void lineart_shadow_create_shadow_edge_array(LineartData *ld,
|
|||||||
LRT_ITER_ALL_LINES_BEGIN
|
LRT_ITER_ALL_LINES_BEGIN
|
||||||
{
|
{
|
||||||
/* Only contour and loose edges can actually cast shadows. We allow light contour here because
|
/* Only contour and loose edges can actually cast shadows. We allow light contour here because
|
||||||
* we want to see if it also doubles as a view contouror, in that case we also need to project
|
* we want to see if it also doubles as a view contour, in that case we also need to project
|
||||||
* them. */
|
* them. */
|
||||||
if (!(e->flags & accept_types)) {
|
if (!(e->flags & accept_types)) {
|
||||||
continue;
|
continue;
|
||||||
@@ -383,7 +387,7 @@ static void lineart_shadow_create_shadow_edge_array(LineartData *ld,
|
|||||||
interp_v3_v3v3_db(sedge[i].g2, e->v1->gloc, e->v2->gloc, ga2);
|
interp_v3_v3v3_db(sedge[i].g2, e->v1->gloc, e->v2->gloc, ga2);
|
||||||
|
|
||||||
/* Assign an absurdly big W for initial distance so when triangles show up to catch the
|
/* Assign an absurdly big W for initial distance so when triangles show up to catch the
|
||||||
* shadow, their w must certainlly be smaller than this value so the shadow catches
|
* shadow, their w must certainly be smaller than this value so the shadow catches
|
||||||
* successfully. */
|
* successfully. */
|
||||||
sedge[i].fbc1[3] = 1e30;
|
sedge[i].fbc1[3] = 1e30;
|
||||||
sedge[i].fbc2[3] = 1e30;
|
sedge[i].fbc2[3] = 1e30;
|
||||||
@@ -712,7 +716,7 @@ static bool lineart_shadow_cast_onto_triangle(LineartData *ld,
|
|||||||
|
|
||||||
/* Bound box check. Because we have already done occlusion in the shadow camera, so any visual
|
/* Bound box check. Because we have already done occlusion in the shadow camera, so any visual
|
||||||
* intersection found in this function must mean that the triangle is behind the given line so it
|
* intersection found in this function must mean that the triangle is behind the given line so it
|
||||||
* will always project a shadow, hence no need to do depth boundbox check. */
|
* will always project a shadow, hence no need to do depth bound-box check. */
|
||||||
if ((MAX3(FBC0[0], FBC1[0], FBC2[0]) < MIN2(LFBC[0], RFBC[0])) ||
|
if ((MAX3(FBC0[0], FBC1[0], FBC2[0]) < MIN2(LFBC[0], RFBC[0])) ||
|
||||||
(MIN3(FBC0[0], FBC1[0], FBC2[0]) > MAX2(LFBC[0], RFBC[0])) ||
|
(MIN3(FBC0[0], FBC1[0], FBC2[0]) > MAX2(LFBC[0], RFBC[0])) ||
|
||||||
(MAX3(FBC0[1], FBC1[1], FBC2[1]) < MIN2(LFBC[1], RFBC[1])) ||
|
(MAX3(FBC0[1], FBC1[1], FBC2[1]) < MIN2(LFBC[1], RFBC[1])) ||
|
||||||
@@ -1055,7 +1059,7 @@ static void lineart_shadow_register_enclosed_shapes(LineartData *ld, LineartData
|
|||||||
e = shadow_ld->pending_edges.array[i];
|
e = shadow_ld->pending_edges.array[i];
|
||||||
|
|
||||||
/* Only care about shade-on-light and light-on-light situations, hence we only need
|
/* Only care about shade-on-light and light-on-light situations, hence we only need
|
||||||
* non-occludded segments in shadow buffer. */
|
* non-occluded segments in shadow buffer. */
|
||||||
if (e->min_occ > 0) {
|
if (e->min_occ > 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1103,7 +1107,7 @@ static void lineart_shadow_register_enclosed_shapes(LineartData *ld, LineartData
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This call would internally duplicate #original_ld, override necessary configureations for shadow
|
/* This call would internally duplicate #original_ld, override necessary configurations for shadow
|
||||||
* computations. It will return:
|
* computations. It will return:
|
||||||
*
|
*
|
||||||
* 1) Generated shadow edges in format of `LineartElementLinkNode` which can be directly loaded
|
* 1) Generated shadow edges in format of `LineartElementLinkNode` which can be directly loaded
|
||||||
@@ -1151,7 +1155,7 @@ bool lineart_main_try_generate_shadow(Depsgraph *depsgraph,
|
|||||||
ld->conf.do_shadow_cast = true;
|
ld->conf.do_shadow_cast = true;
|
||||||
ld->shadow_data_pool = shadow_data_pool;
|
ld->shadow_data_pool = shadow_data_pool;
|
||||||
|
|
||||||
/* See LineartData::edge_data_pool for explaination. */
|
/* See LineartData::edge_data_pool for explanation. */
|
||||||
if (ld->conf.shadow_selection) {
|
if (ld->conf.shadow_selection) {
|
||||||
ld->edge_data_pool = shadow_data_pool;
|
ld->edge_data_pool = shadow_data_pool;
|
||||||
}
|
}
|
||||||
@@ -1180,7 +1184,7 @@ bool lineart_main_try_generate_shadow(Depsgraph *depsgraph,
|
|||||||
}
|
}
|
||||||
ld->qtree.recursive_level = is_persp ? LRT_TILE_RECURSIVE_PERSPECTIVE : LRT_TILE_RECURSIVE_ORTHO;
|
ld->qtree.recursive_level = is_persp ? LRT_TILE_RECURSIVE_PERSPECTIVE : LRT_TILE_RECURSIVE_ORTHO;
|
||||||
|
|
||||||
/* Contour and loose edge from light viewing direction will be casted as shadow, so only
|
/* Contour and loose edge from light viewing direction will be cast as shadow, so only
|
||||||
* force them on. If we need lit/shaded information for other line types, they are then
|
* force them on. If we need lit/shaded information for other line types, they are then
|
||||||
* enabled as-is so that cutting positions can also be calculated through shadow projection.
|
* enabled as-is so that cutting positions can also be calculated through shadow projection.
|
||||||
*/
|
*/
|
||||||
@@ -1250,7 +1254,7 @@ bool lineart_main_try_generate_shadow(Depsgraph *depsgraph,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ld->conf.shadow_enclose_shapes) {
|
if (ld->conf.shadow_enclose_shapes) {
|
||||||
/* Need loaded data for reprojecting the 3rd time to get shape boundary against lit/shaded
|
/* Need loaded data for re-projecting the 3rd time to get shape boundary against lit/shaded
|
||||||
* region. */
|
* region. */
|
||||||
(*r_shadow_ld_if_reproject) = ld;
|
(*r_shadow_ld_if_reproject) = ld;
|
||||||
}
|
}
|
||||||
@@ -1342,7 +1346,7 @@ void lineart_main_transform_and_add_shadow(LineartData *ld,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Does the 3rd stage reprojection, will not re-load objects because #shadow_ld is not deleted.
|
/* Does the 3rd stage reprojection, will not re-load objects because #shadow_ld is not deleted.
|
||||||
* Only reprojects view camera edges and check visibility in light camera, then we can determine
|
* Only re-projects view camera edges and check visibility in light camera, then we can determine
|
||||||
* whether an edge landed on a lit or shaded area. */
|
* whether an edge landed on a lit or shaded area. */
|
||||||
void lineart_main_make_enclosed_shapes(LineartData *ld, LineartData *shadow_ld)
|
void lineart_main_make_enclosed_shapes(LineartData *ld, LineartData *shadow_ld)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ unsigned long long MTLCommandBufferManager::event_signal_val = 0;
|
|||||||
int MTLCommandBufferManager::num_active_cmd_bufs = 0;
|
int MTLCommandBufferManager::num_active_cmd_bufs = 0;
|
||||||
|
|
||||||
/* -------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------- */
|
||||||
/** \name MTLCommandBuffer initialisation and render coordination.
|
/** \name MTLCommandBuffer initialization and render coordination.
|
||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
void MTLCommandBufferManager::prepare(MTLContext *ctx, bool supports_render)
|
void MTLCommandBufferManager::prepare(MTLContext *ctx, bool supports_render)
|
||||||
|
|||||||
@@ -1062,8 +1062,8 @@ typedef struct LineartGpencilModifierData {
|
|||||||
char source_vertex_group[64];
|
char source_vertex_group[64];
|
||||||
char vgname[64];
|
char vgname[64];
|
||||||
|
|
||||||
/* Camera focal length is divided by (1 + overscan), before caluclation, which give a wider FOV,
|
/* Camera focal length is divided by (1 + over-scan), before calculation, which give a wider FOV,
|
||||||
* this doesn't change coordinates range internally (-1, 1), but makes the caluclated frame
|
* this doesn't change coordinates range internally (-1, 1), but makes the calculated frame
|
||||||
* bigger than actual output. This is for the easier shifting calculation. A value of 0.5 means
|
* bigger than actual output. This is for the easier shifting calculation. A value of 0.5 means
|
||||||
* the "internal" focal length become 2/3 of the actual camera. */
|
* the "internal" focal length become 2/3 of the actual camera. */
|
||||||
float overscan;
|
float overscan;
|
||||||
|
|||||||
@@ -51,16 +51,18 @@ typedef enum eLineartEdgeFlag {
|
|||||||
LRT_EDGE_FLAG_LOOSE = (1 << 5),
|
LRT_EDGE_FLAG_LOOSE = (1 << 5),
|
||||||
LRT_EDGE_FLAG_LIGHT_CONTOUR = (1 << 6),
|
LRT_EDGE_FLAG_LIGHT_CONTOUR = (1 << 6),
|
||||||
/* LRT_EDGE_FLAG_FOR_FUTURE = (1 << 7), */
|
/* LRT_EDGE_FLAG_FOR_FUTURE = (1 << 7), */
|
||||||
/* It's a legacy limit of 8 bits for feature lines that come from original mesh edges. It should
|
/**
|
||||||
not be needed in current object loading scheme, but might still be relevant if we are to
|
* It's a legacy limit of 8 bits for feature lines that come from original mesh edges. It should
|
||||||
impelment EditMesh loading, so don't exceed 8 bits just yet. */
|
* not be needed in current object loading scheme, but might still be relevant if we are to
|
||||||
|
* implement edit-mesh loading, so don't exceed 8 bits just yet.
|
||||||
|
*/
|
||||||
LRT_EDGE_FLAG_PROJECTED_SHADOW = (1 << 8),
|
LRT_EDGE_FLAG_PROJECTED_SHADOW = (1 << 8),
|
||||||
/* To determine an edge to be occluded from the front or back face it's lying on. */
|
/* To determine an edge to be occluded from the front or back face it's lying on. */
|
||||||
LRT_EDGE_FLAG_SHADOW_FACING_LIGHT = (1 << 9),
|
LRT_EDGE_FLAG_SHADOW_FACING_LIGHT = (1 << 9),
|
||||||
/** Also used as discarded line mark. */
|
/** Also used as discarded line mark. */
|
||||||
LRT_EDGE_FLAG_CHAIN_PICKED = (1 << 10),
|
LRT_EDGE_FLAG_CHAIN_PICKED = (1 << 10),
|
||||||
LRT_EDGE_FLAG_CLIPPED = (1 << 11),
|
LRT_EDGE_FLAG_CLIPPED = (1 << 11),
|
||||||
/** Used to specify contor from viewing camera when computing shadows. */
|
/** Used to specify contour from viewing camera when computing shadows. */
|
||||||
LRT_EDGE_FLAG_CONTOUR_SECONDARY = (1 << 12),
|
LRT_EDGE_FLAG_CONTOUR_SECONDARY = (1 << 12),
|
||||||
/** Limited to 16 bits for the entire thing. */
|
/** Limited to 16 bits for the entire thing. */
|
||||||
|
|
||||||
|
|||||||
@@ -1222,7 +1222,7 @@ static void do_render_compositor(Render *re)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* weak... the display callback wants an active renderlayer pointer... */
|
/* Weak: the display callback wants an active render-layer pointer. */
|
||||||
if (re->result != NULL) {
|
if (re->result != NULL) {
|
||||||
re->result->renlay = render_get_active_layer(re, re->result);
|
re->result->renlay = render_get_active_layer(re, re->result);
|
||||||
re->display_update(re->duh, re->result, NULL);
|
re->display_update(re->duh, re->result, NULL);
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ RenderResult *render_result_new(Render *re,
|
|||||||
} \
|
} \
|
||||||
} while (false)
|
} while (false)
|
||||||
|
|
||||||
/* A renderlayer should always have a Combined pass. */
|
/* A render-layer should always have a "Combined" pass. */
|
||||||
render_layer_add_pass(rr, rl, 4, "Combined", view, "RGBA", false);
|
render_layer_add_pass(rr, rl, 4, "Combined", view, "RGBA", false);
|
||||||
|
|
||||||
if (view_layer->passflag & SCE_PASS_Z) {
|
if (view_layer->passflag & SCE_PASS_Z) {
|
||||||
@@ -398,7 +398,7 @@ RenderResult *render_result_new(Render *re,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* a renderlayer should always have a Combined pass */
|
/* A render-layer should always have a "Combined" pass. */
|
||||||
render_layer_add_pass(rr, rl, 4, RE_PASSNAME_COMBINED, view, "RGBA", false);
|
render_layer_add_pass(rr, rl, 4, RE_PASSNAME_COMBINED, view, "RGBA", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2355,7 +2355,7 @@ static int wm_handler_operator_call(bContext *C,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Important to run 'wm_operator_finished' before nullptr-ing the context members. */
|
/* Important to run 'wm_operator_finished' before setting the context members to null. */
|
||||||
if (retval & OPERATOR_FINISHED) {
|
if (retval & OPERATOR_FINISHED) {
|
||||||
wm_operator_finished(C, op, false, true);
|
wm_operator_finished(C, op, false, true);
|
||||||
handler->op = nullptr;
|
handler->op = nullptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user