User Tag List

Results 1 to 5 of 5

Thread: Input? (HWA Effects Question)

  1. #1
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Aug 2006
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Input? (HWA Effects Question)

    I was just updating a flip horizontal effect to use a switch rather than just applied right away so im using a if logic. When the box is ticked it works ok but although i don't get any errors it just returns a white area for the unticked (0) value. I have made various things which work fine now but i have had no luck when it comes to this on/off bit. I need to just pass the original image for the 0 value, i tried Out.Color = Out.Color etc and a few other things but no luck.

    Code:
    // Pixel shader input structure
    struct PS_INPUT
    {
        float4 Position   : POSITION;
        float2 Texture    : TEXCOORD0;
    };
    
    // Pixel shader output structure
    struct PS_OUTPUT
    {
        float4 Color   : COLOR0;
    };
    
    // Global variables
    sampler2D Tex0;
    
    int iFx;
    
    PS_OUTPUT ps_main( in PS_INPUT In )
    {
        // Output pixel
        PS_OUTPUT Out;
    	
        if(iFx==0)
                    Out.Color = tex2D(Tex0, In.Texture) ;
        if(iFx==1)	
    	Out.Color = tex2D(Tex0, float2(1.0-In.Texture.x,In.Texture.y));	
        return Out;
    }
    
    // Effect technique
    technique tech_main
    {
        pass P0
        {
            // shaders
            VertexShader = NULL;
            PixelShader  = compile ps_1_4 ps_main();
        }  
    }
    Im guessing im missing something fairly simple but i haven't used this code type that much so im hoping someone can help. Thanks

  2. #2
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,541
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Input? (HWA Effects Question)

    I think your approach of using a parameter as the bit should work if you hammer out the code properly, but I think theres an even easier solution- having the MMF code apply/remove the effect as necessary. I mean, just using any of the existing flip effects and adding/removing them should do it..

  3. #3
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Input? (HWA Effects Question)

    Try compiling as another pixel shader version.

    There were a lot of changes as the versions increased, I don't think PS1 even supports ifs properly, which would certainly explain why it doesn't work.

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Input? (HWA Effects Question)

    By the way, Sphax actually has such a shader in his shader pack.

  5. #5
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Aug 2006
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Input? (HWA Effects Question)

    Quote Originally Posted by Pixelthief
    I think your approach of using a parameter as the bit should work if you hammer out the code properly, but I think theres an even easier solution- having the MMF code apply/remove the effect as necessary. I mean, just using any of the existing flip effects and adding/removing them should do it..
    Well what i was hoping for was to learn to use switches from this, i can of course switch 2 effect or set one on/off but that means making 2 seperate things or doing it with events. This is just to get used to the code i guess because i plan to make much more complex things so this would not work for what i want this time. Thanks though

    Quote Originally Posted by Dynasoft
    Try compiling as another pixel shader version.

    There were a lot of changes as the versions increased, I don't think PS1 even supports ifs properly, which would certainly explain why it doesn't work.
    Thanks for the tip, I know complex software pack uses PixelShader 2 so would this be the best version now?

    Quote Originally Posted by Looki
    By the way, Sphax actually has such a shader in his shader pack.
    Thanks looki this looks just like what i needed. Seems it uses if and else (if then) which is where i was going wrong i think as i was using 2 if events. Seems i can use else if also for 2 and im guessing more comparisons also. I will have to have a look at this to see whats done but i think this should tell me everything i need to know.

    Thanks for the help everyone i think i should be sorted now

Similar Threads

  1. Question about effects of the # of events on an application
    By ezzypixel in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 11th October 2013, 10:33 PM
  2. Keyboard input vs player control input
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 22nd August 2013, 10:00 PM
  3. Image Effects Question
    By Atom in forum Lua Scripting
    Replies: 6
    Last Post: 24th November 2009, 11:51 AM
  4. question about lights special effects:
    By piki in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 17th August 2007, 06:54 AM
  5. beginner's question about transparency effects
    By Glugmoor in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 17th January 2007, 03:55 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
  •