• Dear Cerberus X User!

    As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.

    Important: If you accept the amended Terms and Rules, you agree to the transfer of your user data to the future forum owner!

    Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.

    Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!

    Accepting ensures:

    - Continued access to your account with a short break for the actual transfer.

    - Retention of your data under the same terms.

    Without consent:

    - You don't have further access to your forum user account.

    - Your account and personal data will be deleted after April 5, 2024.

    - Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.

    We hope to keep you in our community and see you on the forum soon!

    All the best

    Your Cerberus X Team

Tutorial Hue Rotation

GTR

Member
Tutorial Author
Joined
Sep 23, 2020
Messages
13
So for next tutorial i give the code of the huerotator, please try to implement this.

Cerberus:
/* Simple hue rotation filter based on article:
http://beesbuzz.biz/code/hsv_color_transforms.php
Author Daniil from shadertoy
GTR 2020  for CX
*/
uniform sampler2D Texture;

uniform float timer;
uniform float speed;
uniform float freq;
uniform float amp;
 
void shader(){

    //convert clip position to valid tex coords
 
    vec2 uv = (b3d_ClipPosition.st/b3d_ClipPosition.w)*0.5+0.5;
      
    
    float c = cos(timer*speed);
    float s = sin(timer*speed);
    
    mat4 hueRotation =   
                    mat4(      0.299,  0.587,  0.114, 0.0,
                             0.299,  0.587,  0.114, 0.0,
                             0.299,  0.587,  0.114, 0.0,
                                0.000,  0.000,  0.000, 1.0) +
        
                    mat4(     0.701, -0.587, -0.114, 0.0,
                            -0.299,  0.413, -0.114, 0.0,
                            -0.300, -0.588,  0.886, 0.0,
                              0.000,  0.000,  0.000, 0.0) * c +
        
                    mat4(     0.168,  0.330, -0.497, 0.0,
                            -0.328,  0.035,  0.292, 0.0,
                             1.250, -1.050, -0.203, 0.0,
                             0.000,  0.000,  0.000, 0.0) * s;
    
    vec4 pixel = texture2D(Texture, uv);

    
    
    
    
    //write output
    b3d_FragColor=vec4( pixel * hueRotation );
}

You must obtain this : http://gigatron3k.free.fr/html5/CX/huerotation/CerberusGame.html

I will edit this post soon with cxs code, until now good luck :)

Regards
 
Back
Top Bottom