Blender V4.3
image_shader_params.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2021 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "DNA_camera_types.h"
12#include "DNA_image_types.h"
13#include "DNA_scene_types.h"
14
15#include "IMB_imbuf_types.hh"
16
17#include "BKE_image.hh"
18
19#include "image_enums.hh"
20#include "image_space.hh"
21
23
26 float shuffle[4];
27 float far_near[2];
28 bool use_premul_alpha = false;
29
30 void update(AbstractSpaceAccessor *space, const Scene *scene, Image *image, ImBuf *image_buffer)
31 {
33 copy_v4_fl(shuffle, 1.0f);
34 copy_v2_fl2(far_near, 100.0f, 0.0f);
35
37
38 if (scene->camera && scene->camera->type == OB_CAMERA) {
39 const Camera *camera = static_cast<const Camera *>(scene->camera->data);
40 copy_v2_fl2(far_near, camera->clip_end, camera->clip_start);
41 }
42 space->get_shader_parameters(*this, image_buffer);
43 }
44};
45
46} // namespace blender::draw::image_engine
bool BKE_image_has_gpu_texture_premultiplied_alpha(Image *image, ImBuf *ibuf)
Definition image_gpu.cc:41
MINLINE void copy_v2_fl2(float v[2], float x, float y)
MINLINE void copy_v4_fl(float r[4], float f)
@ OB_CAMERA
Contains defines and structs used throughout the imbuf module.
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between camera
virtual void get_shader_parameters(ShaderParameters &r_shader_parameters, ImBuf *image_buffer)=0
input_tx image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "preview_img") .compute_source("compositor_compute_preview.glsl") .do_static_compilation(true)
struct Object * camera
void update(AbstractSpaceAccessor *space, const Scene *scene, Image *image, ImBuf *image_buffer)