CodeWalrus

Development => Calculators => Calc Projects, Programming & Tutorials => Topic started by: Snektron on January 07, 2015, 10:24:51 PM

Title: [Axiom] Simple shadows!
Post by: Snektron on January 07, 2015, 10:24:51 PM
So today i came up with this nice little shadow program in axe.
Unfortunately, it was horribly slow. So i decided to have a
crack at Axiom developement.
(https://lh4.googleusercontent.com/-H9bgcnJcatY/VK2usl70sFI/AAAAAAAABPU/CTLtwhZ_qXI/w96-h64-no/screen.png)
It works by first copying the main buffer to the back buffer,
then looping through each byte of the back buffer and moving it 12 bytes to the right
(one pixel down). Then, depending on the command, one bit right or one bit left.
Although it's not amazingly optimized ASM it works quite well.
I haven't really tested it for bugs, so please use at your own risk :P

EDIT: The tokens are found in the stat-calc menu (at 5, 6 and 7)
Title: Re: [Axiom] Simple shadows!
Post by: Duke "Tape" Eiyeron on January 07, 2015, 10:28:52 PM
Actually, it's a pretty nice idea and a pretty nice result! Have you tried with different graphisms, like hollow shapes?
Title: Re: [Axiom] Simple shadows!
Post by: Snektron on January 07, 2015, 10:39:43 PM
Not yet, but i can guess what happens :p
Title: Re: [Axiom] Simple shadows!
Post by: Keoni29 on January 07, 2015, 11:21:23 PM
Can you move the light source?
Title: Re: [Axiom] Simple shadows!
Post by: Snektron on January 07, 2015, 11:31:59 PM
No it only has 3 angles :/
It was just a quick implementation,
but i think im gonna look more in to
this.
Title: Re: [Axiom] Simple shadows!
Post by: Dream of Omnimaga on January 07, 2015, 11:53:52 PM
Something that would be cool is if you could find a way to make Axe graphics so that instead of 4 shades of gray, you have black, medium gray, white and transparent, Basically, the dark gray layer would display as medium gray and the light gray layer would be white, while the white layer would be transparent. Then with your program, anything that isn't transparent could generate a shadow at the angle of your choice. I'M unsure if this would be ideal in all situations, but I guess it wouldn't hurt to try to see how it looks like, assuming that is feasible. The shadow would be medium gray.


On a side note, nice to see a new ASM programmer :D
Title: Re: [Axiom] Simple shadows!
Post by: aetios on January 09, 2015, 10:18:43 AM
This looks really interesting! How is performance with more than one shape?
Title: Re: [Axiom] Simple shadows!
Post by: Snektron on January 09, 2015, 10:20:17 AM
i haven't really tested, but it shouldnt be more since it does the whole buffer in one go
Title: Re: [Axiom] Simple shadows!
Post by: aetios on January 09, 2015, 10:22:09 AM
Ah, I thought you had to put in objects and then it traced those. Seems I was incorrect :P
Title: Re: [Axiom] Simple shadows!
Post by: TheMachine02 on January 09, 2015, 12:33:03 PM
Seems good  :) can't wait to see where this will go.
Title: Re: [Axiom] Simple shadows!
Post by: Snektron on January 09, 2015, 03:27:32 PM
I'm actually planning something quite big. I'll see if it works out
Title: Re: [Axiom] Simple shadows!
Post by: Dream of Omnimaga on January 09, 2015, 03:44:07 PM
I can't wait to see :D. But remember that if you are still somewhat new to programming or Axe programming, it's generally recommended to start small and experiment. For example, don't do a Portal or Pokémon clone as your first ever Axe project because it might be too much of a burden.
Title: Re: [Axiom] Simple shadows!
Post by: Snektron on January 09, 2015, 03:47:11 PM
Although it is something i tend to do, this project shouldn't be too hard :P.
Actually doing it now :)
Title: Re: [Axiom] Simple shadows!
Post by: Thecoder1998 on January 09, 2015, 05:07:08 PM
Looking pretty awesome, cumred!