Contrast Saturation Brightness – Giavapps CC

 

Shader Setup

 

Giavapps CC provides the following function for initializing the Giavapps CC Contrast Saturation Brightness Shader:

 

cc_shader_csb_init() Initializes local variables and retrieves all uniform handles of the Giavapps CC Contrast Saturation Brightness Shader (shader_giavapps_cc_csb).

 

Then you will just need to set your drawing target with the following function:

 

cc_shader_csb_set() Sets the drawing target to the Giavapps CC Contrast Saturation Brightness Shader (shader_giavapps_cc_csb) and all further drawing will be done using that. You can end shader use with function shader_reset().

 

Local Array

 

You can control the following local array:

 

cc_csb

 

And then access to its values by using the following constants:

 

CC_CSB_MIX Mixes the input color with the output color. (Default Value: 1 – Value: from 0 to 1)

 

CC_CSB_LUMINOSITY_R Red component of the luminosity (affects contrast). (Default Value: 0.5 – Value: from 0 to 1)

 

CC_CSB_LUMINOSITY_G Green component of the luminosity (affects contrast). (Default Value: 0.5 – Value: from 0 to 1)

 

CC_CSB_LUMINOSITY_B Blue component of the luminosity (affects contrast). (Default Value: 0.5 – Value: from 0 to 1)

 

CC_CSB_CONTRAST Contrast correction. (Default Value: 1 – Value: from 0 to 10+)

 

CC_CSB_SATURATION Saturation correction. (Default Value: 1 – Value: from 0 to 10+)

 

CC_CSB_BRIGHTNESS Brightness correction. (Default Value: 1 – Value: from 0 to 10+)

 

Code Examples

 

Giavapps CC Contrast Saturation Brightness Shader

 

Create Event

 

cc_shader_csb_init();//initializes local variables and retrieves all shader uniform handles of the Giavapps CC Contrast Saturation Brightness Shader
cc_csb[CC_CSB_SATURATION] = 3;//applies Saturation color correction

 

Draw Event

 

cc_shader_csb_set();//applies the Giavapps CC Contrast Saturation Brightness Shader
draw_self();//draws the sprite assigned to the instance
shader_reset();//resets the draw target

 

Leave a Reply

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

*