lucid's Recent Forum Activity

  • 6-26-2024

    • Fixed a long standing bug where alpha values weren't multiplying correctly resulting in odd rendering in self-draw mode
    • Changed the default value for blend mode to use effects blend mode. This value should always be used, but we will keep the option in there to avoid breaking old projects
  • Ashley - that was it. Thank you.

  • Ashley

    I altered your drawing plugin example to make a bare bones test. I made it use the this._info.SetHasAnimations(true) instead of this._info.SetHasImage(true) and it just grabs the image from the first frame of the first animation. I also changed the renderer script to draw a series of partially overlapping images with varying opacity.

    This is all it does in render:

    renderer.SetAlphaBlend();
    const imageInfo = this._objectClass.GetAnimations()[0].GetFrames()[0].GetImageInfo();
    const texture = imageInfo.GetTexture();
    
    if (!texture)
    	return;	
    
    const wi = this.GetWorldInfo();
    const quad = wi.GetBoundingQuad();
    const rcTex = imageInfo.GetTexRect();
    
    renderer.SetTexture(texture);
    for (var i = 0; i < 5; i++)
    {
    	renderer.SetOpacity(1.0-(i/4.0));
    	renderer.Quad3(quad, rcTex);
    	quad.offset(-50, 0); 
    	renderer.Quad3(quad, rcTex);
    	quad.offset(-50, 0); 			
    }
    

    Here are the files if you want to test for yourself:

    download test plugin

    download test project

    If I use renderer.SetAlphaBlend() or don't set the blend mode at all, it looks like this:

    You can see it seems to multiply the color value making it brighter and brighter as the opacity gets lower and lower. (Opacity decreases as it goes from right to left)

    I know you said it would require preMultiplied alpha, but just for completeness sake, if I use renderer.SetNoPremultiplyAlphaBlend(), it looks like this:

    If you look to the edges of the head you can see that partially transparent colors have the background color bleed through.

    If I just manually paste separate instances with different opacities in the editor rather than draw them in the Draw function, we get what we would expect:

    Is this a bug in the SDK? Or is there something I can do to make the plugins draw how we see it in that last image?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ashley, for the sake of brevity, let's say I have

    var texture = this.GetObjectClass().GetAnimations()[0].GetFrames()[0].GetImageInfo().GetTexture();
    
    renderer.SetTexture(texture);
    renderer.SetOpacity(1);
    renderer.SetColorRgba(1,1,1,1);
    

    and then a Quad4

    Is there something I could be doing here to change the texture to or from non-premultiplied alpha or premultiplied mode?

  • Hello all, Ashley

    I've been at this for many hours and I can't figure out why it is doing this.

    In the original plugin SDK, within Draw(renderer), I have:

    renderer.SetNoPremultiplyAlphaBlend();
    

    followed by multiple:

    renderer.Quad4(q,finalUv)
    

    This was working on a much older version of C3.

    When I do this with overlapping Quad4s, the background color shows through semi-transparent parts of the quads.

    it should look like this (the red square is fully opaque):

    but instead it looks like this (I made the lower layer green to make the issue more obvious):

    here's another example (none of the green lines should be there. And they appear everywhere there are semi-transparent areas and borders):

    I tried setting

    renderer.SetAlphaBlend().
    

    I tried:

    const wi = this.GetWorldInfo();
    renderer.SetBlendMode(wi.GetBlendMode());
    

    which both result in a different visual issue even when normal blending mode is set. It looks hyper-saturated. Like two semi-transparent items are having their brightness multiplied:

    I also tried:

    • with and without a layer beneath
    • with and without force own texture set for the layer being drawn to
    • using Quad3D2 instead of Quad4
    • using source images of different bitdepths
    • several webGL workarounds I found on the web for similar issues

    but it always has this same result.

    Any ideas?

  • luckyrawatlucky

    8-16-2021

    • Fixed bug (introduced when multi-spritesheet import was added) that prevented non-self-draw zip files from being imported.
  • 8-12-2021

    • Fixed a bug where projects could sometimes freeze on single atlas image projects in newer versions of C3
  • FunkY Koval

    I will look into this in the future. I'm not sure when, but definitely not before late next month, as the move has been delayed and is still eating up a lot of time.

    Chadori

    Thank you. Possibly/probably no bug is definitely good news.

    ibiz

    Yes. Use File | Generate spritesheets for project images and in the dialog that appears make sure to embed the spritesheet info into the file so the plugin can read it. And on the left side of the dialog there are options for how to size the spritesheet including splitting it into multiple sheets.

  • Hello everyone. I'm currently preparing to move to a new city, so I'll be pretty busy and scarce for the next couple of weeks.

    7-7-2021

    • Added support for multiple spritesheets (make sure all sprite sheet json files are in zip)

    Chadori it's definitely not supposed to work like that. I just tried it out, and it's behaving as expected and firing one time for each key. If you want to send me an example of a non-working project I can look into it.

  • Chadori - Hello. Thanks for all your contributions. I made the repository public.

    Could you push those latest changes to the official branch, and I'll merge them. I haven't pushed this latest build to the repository. I'll wait until you're done with that so there are no conflicts.

    everyone

    5-11-2021

    • Fixed a bug where attempting to reimport a Spriter project with any spaces in an object name would cause the plugin to duplicate the object instead of replacing it
  • tween scale not working in Spriter.

    The actual program, or in the plugin?

    Hi lucid, are there any plans to add the "scene graph" ability (add child instead of Pin) to an SCML file in Construct 3? Thanks!

    There are plans. At first that wasn't possible in the SDK, but it has since been added. I haven't had a chance to add it in there yet.

  • if anybody knows

    How do I check in Spriter "if any animation is playing" or "if any animation is not playing" ?

    'Is Paused' (or inverted) should work. The hierarchy thing wasn't supported by the sdk until recently. I will add it in the next build. No ETA on that just yet.

lucid's avatar

lucid

Member since 16 Jan, 2009

Twitter
lucid has 22 followers

Connect with lucid

Trophy Case

  • 15-Year Club
  • Entrepreneur Sold something in the asset store
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

22/44
How to earn trophies