• 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

holzchopf.mojo2overlayshaders - blends like overlay in professional graphics software

Holzchopf

Well-known member
3rd Party Module Dev
Tutorial Author
Joined
Jul 31, 2017
Messages
500
A new tiny module to share: Holzchopf.mojo2overlayshaders

It's a shader supposed to be best suited for colouring of images. It's the mix between multiply blending and additive blending you always wanted. But as shader, of course. So basically, when blending with white, the image gets brighter, when blending with black, it gets darker.

Here's what it does to this image:
doc_grey50.png


With SetColor(0.5, 0.5, 0.5)
doc_grey50.png

(yup, it's supposed to have no effect)

With SetColor(0.0, 0.0, 0.0)
doc_grey0.png


With SetColor(1.0, 1.0, 1.0)
doc_grey100.png


With SetColor(1.0, 0.0, 0.0)
doc_red100.png


For now, there's only one shader in the module. But maybe there will be more in the future.
 

Attachments

  • holzchopf.mojo2overlayshaders-20180309.zip
    283 KB · Views: 397
OK fellow coders I went crazy on those fragment shaders and now I have a complete library to share with you!


mojo2fragmentshaders_banner.png


Now there's a whole bunch of shaders that allow you to manipulate the colours of an image in various ways. Plus some transform shaders =)

The overlay shader is still available but got renamed to BlendOverlayShader.

BlendMixShader
mixes vertex and fragment colour 50/50​
BlendMultiplyShader
multiplies vertex and fragment colour​
BlendAddShader
adds vertex and fragment colour​
BlendDarkenShader
takes darker one of vertex or fragment colour per component​
BlendLightenShader
takes brighter one of vertex or fragment colour per component​
BlendInverseMultiplyShader
inverse of product of inverses of vertex and fragment colours​
BlendInverseAddShader
one minus sum of one minus vertex and one minus fragment colour​
BlendOverlayShader
overlay (see first posting)​
BlendHdrLightningShader
like overlay but allows full saturation (hence the high dynamic range in the name)​
BlendAromatShader
like HDR lightning but spiced up. THIS IS THE ROLLS ROYCE OF LIGHTNING SHADERS​
BlendDifferenceShader
difference between vertex and fragment colour​
BlendSaddleShader
lets you gradually slide from normal to inverted image​
BlendGradeShader
reduces colour depth per channel​
TransProjectShader
projects ColorTexture by using a displacement map​
TransDisplaceShader
moves fragments of ColorTexture by using a displacement map​
TransSpreadShader
spreads fragments of ColorTexture relatively to nearest edge by using a displacement map​
GradientFillShader
maps from fragment red channel onto a gradient image​
ColorConvolutionShader
convolutes fragment colours with the colours of vertex​
BumpMapRotatorShader
used for rotating the normals of a bump map​

There's an extensive example in the cerberusdoc sub folder.
 

Attachments

  • holzchopf.mojo2fragmentshaders-20180424.zip
    834.3 KB · Views: 321
Back
Top Bottom