Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
RDPipelineColorBlendStateAttachment
Eredita: RefCounted < Object
Allegato allo stato di fusione dei colori della pipeline (utilizzato da RenderingDevice).
Descrizione
Controlla come viene effettuata la fusione tra i frammenti di origine e destinazione quando si utilizza RenderingDevice.
Per riferimento, ecco come sono implementate le modalità comuni di fusione per gli utenti nel renderer 2D di Godot:
Mescola:
var attachment = RDPipelineColorBlendStateAttachment.new()
attachment.enable_blend = true
attachment.color_blend_op = RenderingDevice.BLEND_OP_ADD
attachment.src_color_blend_factor = RenderingDevice.BLEND_FACTOR_SRC_ALPHA
attachment.dst_color_blend_factor = RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA
attachment.alpha_blend_op = RenderingDevice.BLEND_OP_ADD
attachment.src_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ONE
attachment.dst_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA
Aggiungi:
var attachment = RDPipelineColorBlendStateAttachment.new()
attachment.enable_blend = true
attachment.alpha_blend_op = RenderingDevice.BLEND_OP_ADD
attachment.color_blend_op = RenderingDevice.BLEND_OP_ADD
attachment.src_color_blend_factor = RenderingDevice.BLEND_FACTOR_SRC_ALPHA
attachment.dst_color_blend_factor = RenderingDevice.BLEND_FACTOR_ONE
attachment.src_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_SRC_ALPHA
attachment.dst_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ONE
Sottrai:
var attachment = RDPipelineColorBlendStateAttachment.new()
attachment.enable_blend = true
attachment.alpha_blend_op = RenderingDevice.BLEND_OP_REVERSE_SUBTRACT
attachment.color_blend_op = RenderingDevice.BLEND_OP_REVERSE_SUBTRACT
attachment.src_color_blend_factor = RenderingDevice.BLEND_FACTOR_SRC_ALPHA
attachment.dst_color_blend_factor = RenderingDevice.BLEND_FACTOR_ONE
attachment.src_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_SRC_ALPHA
attachment.dst_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ONE
Moltiplica:
var attachment = RDPipelineColorBlendStateAttachment.new()
attachment.enable_blend = true
attachment.alpha_blend_op = RenderingDevice.BLEND_OP_ADD
attachment.color_blend_op = RenderingDevice.BLEND_OP_ADD
attachment.src_color_blend_factor = RenderingDevice.BLEND_FACTOR_DST_COLOR
attachment.dst_color_blend_factor = RenderingDevice.BLEND_FACTOR_ZERO
attachment.src_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_DST_ALPHA
attachment.dst_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ZERO
Alfa premultiplicato:
var attachment = RDPipelineColorBlendStateAttachment.new()
attachment.enable_blend = true
attachment.alpha_blend_op = RenderingDevice.BLEND_OP_ADD
attachment.color_blend_op = RenderingDevice.BLEND_OP_ADD
attachment.src_color_blend_factor = RenderingDevice.BLEND_FACTOR_ONE
attachment.dst_color_blend_factor = RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA
attachment.src_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ONE
attachment.dst_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA
Proprietà
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Metodi
void |
Descrizioni delle proprietà
BlendOperation alpha_blend_op = 0 🔗
void set_alpha_blend_op(value: BlendOperation)
BlendOperation get_alpha_blend_op()
La modalità di fusione da usare per il canale alfa.
BlendOperation color_blend_op = 0 🔗
void set_color_blend_op(value: BlendOperation)
BlendOperation get_color_blend_op()
La modalità di fusione da usare per i canali di colore rosso/verde/blu.
BlendFactor dst_alpha_blend_factor = 0 🔗
void set_dst_alpha_blend_factor(value: BlendFactor)
BlendFactor get_dst_alpha_blend_factor()
Controlla il modo in cui il fattore di fusione per il canale alfa è determinato in base ai frammenti della destinazione.
BlendFactor dst_color_blend_factor = 0 🔗
void set_dst_color_blend_factor(value: BlendFactor)
BlendFactor get_dst_color_blend_factor()
Controlla il modo in cui il fattore di fusione per i canali di colore è determinato in base ai frammenti di destinazione.
Se true, effettua la fusione tra la sorgente e la destinazione in base ai fattori definiti in src_color_blend_factor, dst_color_blend_factor, src_alpha_blend_factor e dst_alpha_blend_factor. Sono prese in considerazione anche le modalità di fusione color_blend_op e alpha_blend_op, con write_r, write_g, write_b e write_a che controllano il risultato.
BlendFactor src_alpha_blend_factor = 0 🔗
void set_src_alpha_blend_factor(value: BlendFactor)
BlendFactor get_src_alpha_blend_factor()
Controlla il modo in cui il fattore di fusione per il canale alfa è determinato in base ai frammenti della sorgente.
BlendFactor src_color_blend_factor = 0 🔗
void set_src_color_blend_factor(value: BlendFactor)
BlendFactor get_src_color_blend_factor()
Controlla il modo in cui il fattore di fusione per i canali di colore è determinato in base ai frammenti della sorgente.
Se true, scrive il nuovo canale alfa al risultato finale.
Se true, scrive il nuovo canale di colore blu al risultato finale.
Se true, scrive il nuovo canale di colore verde al risultato finale.
Se true, scrive il nuovo canale di colore rosso al risultato finale.
Descrizioni dei metodi
void set_as_mix() 🔗
Metodo di convenienza per effettuare la fusione standard con alfa retto (non premoltiplicato). Questo imposta enable_blend su true, src_color_blend_factor su RenderingDevice.BLEND_FACTOR_SRC_ALPHA, dst_color_blend_factor su RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, src_alpha_blend_factor su RenderingDevice.BLEND_FACTOR_SRC_ALPHA e dst_alpha_blend_factor su RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA.