<div dir="ltr"><div dir="ltr"><div>Well, you got me motivated, so I started on stencil slices. I did underestimate how easy it would be, but have a working mockup.<br></div><div><img src="cid:ii_k1pzid6a0" alt="22_stencil_slice.gif" width="451" height="216"></div><div>Two weeks is a pretty short deadline. As I said, this won't be in Fufluns (I won't be committing these changes to SVN until after the Fufluns branch is made, and we don't want to create branches for stable releases long before the actual release, so that the  release candidates are just the nightly builds). I also need to rewrite the implementation to allow all slice kinds to be used both as stencil and as children of a stencil: right now it only works for non-transparent sprites parented to a stencil sprite. Even with all the planning I did I still got it wrong! Planning is no substitute for experimentation.<br></div><div>But it's already good enough for your purposes, and I really really want to release Fufluns within two weeks anyway, so maybe you can use it afterall, if you haven't already done it manually.<br></div><div><br></div><div>Technical details, since I'm CC'ing to the mailing list:</div><div><br>I'd also like to allow multiple sprites/slices to be OR'd into a single stencil, but I'm not sure yet how to do that. Possibly the additional stencils would be children of the main stencil, with a "Combine with parent stencil" setting.<br><br>Also, I will allow transparent stencils (stencils are actually implemented using the alpha layer/mask, so transparency comes for free).<br>I'm implementing stencils in a way that will allow a straight-forward hardware accelerated implementation when we add that, although the initial implementation is with software and could work any way I want.<br>The funny thing is OpenGL has something called "stencils" but they are useless for my purposes since there's no way to set the stencil mask to a bitmap; if you want to draw something in the mask you have to split it into triangles. So I'm forced to instead implement stencils using the alpha layer and a framebuffer (FBO). Also I don't want to use OpenGL directly if I can avoid it, but go through SDL 2 for rendering, since it has separate backends for DirectX9, OpenGL ES 2.0, OpenGL, etc. SDL2 exposes FBOs as render-target textures, and it allows custom blend modes, but it doesn't expose stencils or depth buffers. (Note I don't have real OpenGL experience, just reading a bunch of docs over the years.)<br>OpenGL stencils would not allow transparency (and since OpenGL is just exposing a feature of the render output units (ROP) on GPUs I assume all other graphics APIs have the same limitation).</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 12 Oct 2019 at 03:33, Matt Edson <<a href="mailto:colesloth@gmail.com" target="_blank">colesloth@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Haha, in like two weeks. I'm already going to plan on doing it manually. No need in escalating anything on my account. I was just seeing if it was available already or if it was something easy as some of my requests are, like when James did Shrink to Center, which was amazing.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 11, 2019 at 10:14 AM Ralph Versteegen <<a href="mailto:teeemcee@gmail.com" target="_blank">teeemcee@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>This is something I've wanted to implement for years! I'm sure people would find interesting uses of it, such as drawing reflections.<br></div><div>It's actually not hard to implement, and the reason I haven't was because I wasn't sure exactly how to go about it (there are a lot of ways it could work) so that it could be feasibly reimplemented when we switch to hardware-accelerated rendering, and in particular, when using SDL 2 for rendering, which is far more restrictive than using OpenGL/DirectX/etc directly. But a couple months ago I spent most of a day reading the SDL 2 graphics drivers source code, OpenGL docs, etc, to figure this out and confirmed that this should be possible to implement in SDL2 by using a destination texture alpha channel and custom blend mode. That means I can implement it in our current software renderer too.<br></div><div><br></div><div></div><div>I'm certainly not going to do this before Fufluns is released, and I don't know when exactly I'll get to it, since there are so many different things I want to do after Fufluns is released. When would you need it by?</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 11 Oct 2019 at 14:43, Matt Edson <<a href="mailto:colesloth@gmail.com" target="_blank">colesloth@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">No worries. I wanted to check before I did anything. Thanks!<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 10, 2019 at 9:40 PM James Paige <<a href="mailto:Bob@hamsterrepublic.com" target="_blank">Bob@hamsterrepublic.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>That would be so cool!<br></div><div><br></div><div>We don't have a clipping bitmap slice, although that would be a fantastic feature which I would love to add someday in the future. I have no idea how difficult it would be to implement, so I couldn't guess how long it will take.</div><div><br></div><div>For now, you best bet is to just animate it as a bunch of sprites</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 10, 2019 at 5:23 PM Matt Edson <<a href="mailto:colesloth@gmail.com" target="_blank">colesloth@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hey guys...</div><div><br></div><div>So I'm getting ready to move on to the next area for Axe Cop and I do fancy intros for all of the levels. I had this idea today where I could do a clipping mask of the word WATER in a font that I figure out and I was kind of hoping to make a clipping mask of it and then I was going to ascend a graphic of running water through it so it would look like the word Water was filling up with water to fill it up and it'd look really cool.</div><div><br></div><div>I opened the container area of the slice editor and it seems I can only do rectangles. Is there any way to do this idea/and/or is there an easy way to implement custom containers for this type of thing or is it one of those things I should just brainstorm a new idea for the title card of the level?</div><div><br></div><div>This idea worked well just because the stage is about raising and lowering the levels of water. I could draw all of the frames manually but I try to be the most economic with my resources and that'd be a ton of new giant sprites.</div><div><br></div><div>Let me know! Thanks dudes!</div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div></div>