This commit removes all EEVEE specific code from the `gpu_shader_material*.glsl` files. It defines a clear interface to evaluate the closure nodes leaving more flexibility to the render engine. Some of the long standing workaround are fixed: - bump mapping support is no longer duplicating a lot of node and is instead compiled into a function call. - bump rewiring to Normal socket is no longer needed as we now use a global `g_data.N` for that. Closure sampling with upstread weight eval is now supported if the engine needs it. This also makes all the material GLSL sources use `GPUSource` for better debugging experience. The `GPUFunction` parsing now happens in `GPUSource` creation. The whole `GPUCodegen` now uses the `ShaderCreateInfo` and is object type agnostic. Is has also been rewritten in C++. This patch changes a view behavior for EEVEE: - Mix shader node factor imput is now clamped. - Tangent Vector displacement behavior is now matching cycles. - The chosen BSDF used for SSR might change. - Hair shading may have very small changes on very large hairs when using hair polygon stripes. - ShaderToRGB node will remove any SSR and SSS form a shader. - SSS radius input now is no longer a scaling factor but defines an average radius. The SSS kernel "shape" (radii) are still defined by the socket default values. Appart from the listed changes no other regressions are expected.
51 lines
1.5 KiB
C++
51 lines
1.5 KiB
C++
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
* Copyright 2005 Blender Foundation. All rights reserved. */
|
|
|
|
/** \file
|
|
* \ingroup gpu
|
|
*
|
|
* Uniform buffers API. Used to handle many uniforms update at once.
|
|
* Make sure that the data structure is compatible with what the implementation expect.
|
|
* (see "7.6.2.2 Standard Uniform Block Layout" from the OpenGL spec for more info about std140
|
|
* layout)
|
|
* Rule of thumb: Padding to 16bytes, don't use vec3, don't use arrays of anything that is not vec4
|
|
* aligned .
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
struct ListBase;
|
|
|
|
/** Opaque type hiding blender::gpu::UniformBuf. */
|
|
typedef struct GPUUniformBuf GPUUniformBuf;
|
|
|
|
GPUUniformBuf *GPU_uniformbuf_create_ex(size_t size, const void *data, const char *name);
|
|
/**
|
|
* Create UBO from inputs list.
|
|
* Return NULL if failed to create or if \param inputs: is empty.
|
|
*
|
|
* \param inputs: ListBase of #BLI_genericNodeN(#GPUInput).
|
|
*/
|
|
GPUUniformBuf *GPU_uniformbuf_create_from_list(struct ListBase *inputs, const char *name);
|
|
|
|
#define GPU_uniformbuf_create(size) GPU_uniformbuf_create_ex(size, NULL, __func__);
|
|
|
|
void GPU_uniformbuf_free(GPUUniformBuf *ubo);
|
|
|
|
void GPU_uniformbuf_update(GPUUniformBuf *ubo, const void *data);
|
|
|
|
void GPU_uniformbuf_bind(GPUUniformBuf *ubo, int slot);
|
|
void GPU_uniformbuf_unbind(GPUUniformBuf *ubo);
|
|
void GPU_uniformbuf_unbind_all(void);
|
|
|
|
#define GPU_UBO_BLOCK_NAME "node_tree"
|
|
#define GPU_ATTRIBUTE_UBO_BLOCK_NAME "unf_attrs"
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|