User Tag List

Results 1 to 3 of 3

Thread: [Request] Set pixel color

  1. #1
    Clicker Multimedia Fusion 2 Developer
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Aug 2006
    Location
    goblincolony.com
    Posts
    118
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    [Request] Set pixel color

    I want this simple effect, set pixel (x,y) to color (rgb).

    Basicly the same function as Surface objects "set pixel" action (Surface : Set pixel at (X( "object" ),Y( "object" )) to GetRGB(255, 0, 0))
    The reason I won't use surface object is because it feels wrong to include such a heavy object just for this feature that would be acomplished just as well and faster by a shader, but maybe that's a wrong assumption?

    The shader would have 3 user defined variables (parameters) "Xpixel","Ypixel" and "pixelColor".
    This example would set the pixel at objects position to red:
    Code:
    Set effect parameter "Xpixel" to X("object")
    Set effect parameter "Ypixel" to Y("object")
    Set effect parameter "pixelColor" to to GetRGB(255, 0, 0)
    I feel like this should be really simple to do so I tried making this myself but I can't figure out how to set the pixel coordinates and only end up with a fully colored texture...
    Anyway, here's an (incomplete) xml for copy/paste to maybe save you some time and clarify what I want:

    <effect>
    <name>Set pixel</name>
    <description>Sets color of pixel at destination</description>
    // EDIT <author></author>

    <parameter>
    <name>Xpixel</name>
    <code>Xpixel</code>
    <description>Pixel X coordinate.</description>
    // EDIT <type></type>
    <property>edit</property>
    <value>0</value>
    </parameter>

    <parameter>
    <name>Ypixel</name>
    <code>Ypixel</code>
    <description>Pixel Y coordinate.</description>
    // EDIT <type></type>
    <property>edit</property>
    <value>0</value>
    </parameter>

    <parameter>
    <name>pixelColor</name>
    <code>pixelColor</code>
    <description>The color of the pixel.</description>
    <type>int_float4</type>
    <property>color</property>
    </parameter>
    </effect>

  2. #2
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    defisym's Avatar
    Join Date
    Jun 2017
    Location
    Asia
    Posts
    581
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    I’m afraid shader cannot do this, cause it doesn’t save previous result, unless you only need to change one pixel.
    By the way, everything that can display contents has a surface (fusion’s display class), and surface (extension) is a wrapper of surface (class), so it’s not that slow or heavy. Although most of surface class’s functions are done by software, they are already fast enough, besides stretch, rotate and blit. And fusion now provides HWA versions of blitex that do stretch and rotate together.

  3. #3
    Clicker Multimedia Fusion 2 Developer
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Aug 2006
    Location
    goblincolony.com
    Posts
    118
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Oh I see. Well thanks for the info. I'll just use the surface object.

Similar Threads

  1. Change the color of a pixel
    By hamdi369 in forum Android Export Module 2.5
    Replies: 0
    Last Post: 12th October 2016, 06:11 AM
  2. [Request] Get Pixel Color Object
    By macca02 in forum Extension Development
    Replies: 6
    Last Post: 12th November 2013, 08:56 AM
  3. Get color/ RGB value from specific pixel
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 11th July 2012, 03:41 PM
  4. Get the color of a pixel at X,Y
    By Keith in forum iOS Export Module Version 2.0
    Replies: 2
    Last Post: 19th September 2011, 03:50 AM
  5. Collision Pixel Color
    By Blood_Wist in forum Multimedia Fusion 2 - Technical Support
    Replies: 12
    Last Post: 13th December 2010, 04:17 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
  •