Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 17 Nov 2008
Offline Last Active May 26 2016 02:02 PM

Posts I've Made

In Topic: How can I recognize hand drawn shapes? (eg. the wizard in Trine)

15 August 2014 - 03:31 PM

All great posts, thank you!


Echo17's stroke based implementation best matches the slightly-modified idea mentioned above, it can easily recognize shapes being drawn from any combination of directions, so I'll probably use that. It is the first library linked in my original post, Drawing Engine.


The other engine, HyperGlyph, also still stands out - but hasn't been updated in over two years. Drawing Engine was updated two weeks ago, so it makes it a much easier choice.


Thanks again!

In Topic: How can I recognize hand drawn shapes? (eg. the wizard in Trine)

14 August 2014 - 06:16 PM

Follow up from my own research: ends up there's no simple solution, should have figured. My options are either to go through the full learned state idea where a library is taught what to look for with examples, or you program it to compare against the sizes of a few basic shapes and nothing more.




This article was the most helpful, and it looks like there's no easy or intuitive solution to this. The closest is...


1. Get convex hull for current shape (like putting a rubber band around it)

2. Compare convex hull to smallest of X shape that would fit around it (circle, then square, then triangle, etc)

3. If areas are almost one to one, they are probably the same shape.


It's pretty good for what it sets out to achieve, but it can't handle interesting shapes that are different, but have similar convex shapes (so ellipses and diamonds are tricky for it).


If I find any better options, I'll report back here, but for now it looks like this isn't a good enough approach, so a library is probably necessary.

In Topic: How to draw visible shadow volumes, but through transparent polygons too

08 July 2014 - 12:02 AM

Alright, final product is a combination of the partial solution and a workaround. When you touch a block, it immediately switches to 50% opacity and disables itself as a shadow surface, but also doesn't render before shadows again until after it's back at 100%. The shadows disappear when the crumbling blocks are touched then, but appear as soon as they're whole again, and all transparencies look good.


So it's about 80% of what I hoped for, and it looks good. :) Thanks guys!

In Topic: How to draw visible shadow volumes, but through transparent polygons too

05 July 2014 - 06:32 PM


The problem is: even at alpha zero, they're affecting the depth test for my stencil buffer.

Transparent objects shouldn't render depth. Won't the problem go away if you disable depth writes for the crumbling blocks?



This is a lot better, but doesn't solve everything:




So, no depth test on crumbling blocks = awesome shadows passing through!


Heck, they go so far through it's like the crumbling blocks aren't even there!


...ah shoot, it's like the crumbling blocks aren't even there. Now there are no shadows on top. As you can see, I've added some crumbling blocks above the other crumbling blocks. With the old way, the shadow recognizes the blocks and lands on it.




But the new way makes that shadow invisible.


So what can I do to address that? Multiple passes won't work because if it goes...


noDepth crumblingBlocks


depth crumblingBlocks



...well, for one: it does this funky shadow thing:




That's because the shadow is applied twice to everything at the bottom (I could probably clean that up by finding the difference of the two stencils though and not drawing anything twice) but two:




If I look through transparent crumbling blocks at the shadow of other blocks on TOP of crumbling blocks... nothing appears. I would have to do one of these passes for every single vertical layer of my game world. :|


So more dilemma! I want both to use the blocks with depth test, so I can draw shadows on top of them, but also without so I can draw shadows beneath them. Ah... any tips on this?

In Topic: Any options for affordable ray tracing?

15 February 2014 - 02:26 PM

Great video and articles, thanks kalle_h! Any idea if he plans to make the code public?