User Tag List

Results 1 to 5 of 5

Thread: Can anyone help me fix one issue with my palette swap shader?

  1. #1
    Clicker Fusion 2.5 (Steam)
    Warguy555's Avatar
    Join Date
    Feb 2019
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Can anyone help me fix one issue with my palette swap shader?

    I recently wrote a palette swap shader that is functional, I just don't like how you have to specify the v coordinate on the palette. I posted the shader on the unofficial Clickteam Fusion Reddit page and got no response on how to fix the issue. Essentially, the palette image is an image with the x amount of pixels representing the number of colors in the palette, and the y axis is supposed to specify which palette to use. The problem is I want to use the y/height value to determine which palette to use from the image parameter. Currently, you have to manually type in the v coordinate from the UVs instead of just a simple integer that does the math automatically. Does anyone know how to perform such an operation?

    Reddit Post:
    https://www.reddit.com/r/clickteam/c...hader/gyptit3/

    Files:
    CTF2.5_PaletteSwapShaderFiles.zip

  2. #2
    Clicker Fusion 2.5 (Steam)
    Warguy555's Avatar
    Join Date
    Feb 2019
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    UPDATE 5/20/2021:

    I fixed the issue I was having. It was related to the compiler and it works just fine now. Even so, the user has to directly enter the height of the palette image input parameter. That is not desirable but it works. Does anyone know a way to get the height in pixels of an image from a texture/image input inside a shader like that?

    Consider the following, a user has to enter 21 if the texture is 21 pixels tall. I want the shader to automatically get the height of the image input parameter so the user only has to enter one numerical value instead of two.

  3. #3
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,398
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    There's no way to directly get the texture dimensions from within the shader (there's no fPixelWidth / fPixelHeight equivalent for image parameters), so you will need to pass them in as separate parameters, which can be done easily enough - for example, you could just load the texture into a Picture object (or Active, or Active Picture, or Surface or whatever...) and then retrieve its dimensions from there.

  4. #4
    Clicker Fusion 2.5 (Steam)
    Warguy555's Avatar
    Join Date
    Feb 2019
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Fair enough. I didn't think about doing that with a separate image to get the dimensions for use with the shader parameter. Oh well, at least the shader actually works properly now. Thanks for the input, MuddyMole. Anyway, I am going to finish cleaning up the shader and I'll release a finished version on the Reddit page and possibly in a new thread on the community page.

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module

    Join Date
    Feb 2014
    Posts
    1,072
    Mentioned
    29 Post(s)
    Tagged
    1 Thread(s)
    hey, i'm super interested in this

    can u link me when its done please

    also, wats the performance like on the shader? as the standard fusion replace color command is so slow that its unusable

Similar Threads

  1. RGB Coefficient to palette swap character?
    By No_One in forum Fusion 2.5 Free Version
    Replies: 2
    Last Post: 31st March 2020, 02:33 AM
  2. Palette Swap/Color Replace Shader
    By JayTholen in forum Paid Design & Development Requests
    Replies: 1
    Last Post: 6th June 2016, 10:32 AM
  3. Color Swap Shader
    By Shin in forum Hardware Accelerated Runtime
    Replies: 10
    Last Post: 20th November 2009, 06:44 AM
  4. Easier method for palette swap/replace color?
    By N64Mario in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 26th November 2008, 05:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •