Levels – Giavapps CC

 

Shader Setup

 

Giavapps CC provides the following function for initializing the Giavapps CC Levels Shader:

 

cc_shader_levels_init() Initializes local variables and retrieves all uniform handles of the Giavapps CC Levels Shader (shader_giavapps_cc_levels).

 

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

 

cc_shader_levels_set() Sets the drawing target to the Giavapps CC Levels Shader (shader_giavapps_cc_levels) and all further drawing will be done using that. You can end shader use with function shader_reset().

 

Local Array

 

giavapps_cc_shader_adobe_photoshop_levels

 

You can control the following local array:

 

cc_levels

 

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

 

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

 

CC_LEVELS_GAMMA_R Red component of the gamma correction. (Default Value: 1 – Value: from 0 to 10+)

 

CC_LEVELS_GAMMA_G Green component of the gamma correction. (Default Value: 1 – Value: from 0 to 10+)

 

CC_LEVELS_GAMMA_B Blue component of the gamma correction. (Default Value: 1 – Value: from 0 to 10+)

 

CC_LEVELS_INPUT_MIN_R Red component of the minimum input color control. (Default Value: 0 – Value: from 0 to 1)

 

CC_LEVELS_INPUT_MIN_G Green component of the minimum input color control. (Default Value: 0 – Value: from 0 to 1)

 

CC_LEVELS_INPUT_MIN_B Blue component of the minimum input color control. (Default Value: 0 – Value: from 0 to 1)

 

CC_LEVELS_INPUT_MAX_R Red component of the maximum input color control. (Default Value: 1 – Value: from 0 to 1)

 

CC_LEVELS_INPUT_MAX_G Green component of the maximum input color control. (Default Value: 1 – Value: from 0 to 1)

 

CC_LEVELS_INPUT_MAX_B Blue component of the maximum input color control. (Default Value: 1 – Value: from 0 to 1)

 

CC_LEVELS_OUTPUT_MIN_R Red component of the minimum output color control. (Default Value: 0 – Value: from 0 to 1)

 

CC_LEVELS_OUTPUT_MIN_G Green component of the minimum output color control. (Default Value: 0 – Value: from 0 to 1)

 

CC_LEVELS_OUTPUT_MIN_B Blue component of the minimum output color control. (Default Value: 0 – Value: from 0 to 1)

 

CC_LEVELS_OUTPUT_MAX_R Red component of the maximum output color control. (Default Value: 1 – Value: from 0 to 1)

 

CC_LEVELS_OUTPUT_MAX_G Green component of the maximum output color control. (Default Value: 1 – Value: from 0 to 1)

 

CC_LEVELS_OUTPUT_MAX_B Blue component of the maximum output color control. (Default Value: 1 – Value: from 0 to 1)

 

Code Examples

 

Giavapps CC Levels Shader

 

Create Event

 

cc_shader_levels_init();//initializes local variables and retrieves all shader uniform handles of the Giavapps CC Levels Shader
cc_levels[CC_LEVELS_GAMMA_R] = 1.2;//applies Gamma correction on the Red channel
cc_levels[CC_LEVELS_GAMMA_G] = 1.2;//applies Gamma correction on the Green channel
cc_levels[CC_LEVELS_GAMMA_B] = 1.2;//applies Gamma correction on the Blue channel

 

Draw Event

 

cc_shader_levels_set();//applies the Giavapps CC Levels Shader
draw_self();//draws the sprite assigned to the instance
shader_reset();//resets the draw target

 

I am Luigi Piscopo, also known as DJ GiDeejay / Producer / Remixer in the music world. I am a Producer with a lot of experience in photo editing, video editing, audio editing, graphic design, web design, programming and promotion.

 

Leave a Reply

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

*