Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yadurajiv/Ray-Casting-Soft-Shadows
ray casting and soft shadow example written in ActionScript
https://github.com/yadurajiv/Ray-Casting-Soft-Shadows
Last synced: about 2 months ago
JSON representation
ray casting and soft shadow example written in ActionScript
- Host: GitHub
- URL: https://github.com/yadurajiv/Ray-Casting-Soft-Shadows
- Owner: yadurajiv
- Created: 2012-03-31T09:34:04.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2013-03-16T10:55:03.000Z (almost 12 years ago)
- Last Synced: 2024-08-03T05:05:26.316Z (5 months ago)
- Language: ActionScript
- Homepage: https://dl.dropbox.com/u/1526334/yrdcExtra/rayCastingSoftShadows/index.html
- Size: 477 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
- awesome-actionscript-sorted - Ray-Casting-Soft-Shadows - ray casting and soft shadow example written in ActionScript (Unsorted / Other API)
README
This is a ray casting and soft shadow example written in ActionScript.
As seen here - https://dl.dropbox.com/u/1526334/yrdcExtra/rayCastingSoftShadows/index.html
2D Raycasting and Soft shadows - realtime in flash. I had to make a small framework and a way to create some basic primitives, then moved on to the ray casting bit, and then to shadows.
The (inner/outer)Penumbra is not really rendered as explained in the document, It was drawn initially, but didn't look so great. Instead the shadows were blurred using flash filters. The blend modes (colour blending modes) take more cpu than the actual casting.
Reference: http://www.gamedev.net/page/resources/_/technical/graphics-programming-and-theory/dynamic-2d-soft-shadows-r2032
[Getting it up and running in windows]
Get Flex 4.1
Get Flash Develop
Open rayCastingSoftShadows.as3proj and you are set to go[Command line using mxmlc]
Get Flex 4.1Make sure that JAVA_HOME variable is set to where Java/jre is - (note: win7 64bit might have java64bit in it's path, make sure to use Flex 64bit or point the JAVA_HOME to 32bit jre folder in Progarm Files(x86))
to compile, run mxmlc from the command line inside the Folder
For Debug
mxmlc -optimize=true -output bin/rayCastingSoftShadows.swf -static-link-runtime-shared-libraries=true --target-player=10.0.0 -compiler.debug=true src/Main.asFor Release
mxmlc -optimize=true -output bin/rayCastingSoftShadows.swf -static-link-runtime-shared-libraries=true --target-player=10.0.0 -compiler.debug=false src/Main.asNote: running mxmlc on fcsh(the flash shell which comes with Flex) is much faster if you have to repeatedly compile your code. The same command above will work inside fcsh
[Javascript Port]
You can find a js port of the same by @is__real here - http://www.is-real.net/experiments/canvas/soft-shadows/