I've been working a lot with AGAL vertex and fragment shaders. I've got individual objects lit correctly (including specular shading) but I'd like to have objects cast shadows on OTHER objects. I have looked online, but I think most people working directly with AGAL have built custom Stage3D libraries and the shadow-casting solution doesn't seem to be in the public domain. Anyone willing to change that?
I'd like to know how to get an object to cast a shadow on another. I can't post what I've tried, because I can't get my head around where to begin on this problem. How would you pass the information (whether other objects are blocking the light) into another object's shader?
Thanks.
Shadow-casting shaders in Stage3D
367 Views Asked by moosefetcher At
1
There are 1 best solutions below
Related Questions in ACTIONSCRIPT-3
- How to create an ActionScript 3.0 in Flash to display Current Date, Time and Day of Week
- textinput.needsSoftKeyboard does not work (air for android)
- AS3 Get currentFrame of current MovieClip
- call Win32 API in flex to set Window Display Affinity
- Air Native Extensions: Released Air App w/Windows Native Extension works fine on develpment PC but not on other computers
- TestFlight API and stats with as3
- Error while using removeChild() and accessing members of array
- Flash erase image with mask - gotoandplay next frame
- Adding a listener to a VerticalScrollBar in flex
- AS3 array to clean up long code?
- AS3 - How can objects that appear randomly never touch each other?
- import a sound externally or from the library? AS3
- Nesting Asynchronous Promises in ActionScript
- AS3 - How can multiple objects that appear randomly NEVER touch each other?
- ActionScript + Ruby
Related Questions in FRAGMENT-SHADER
- PBO Indexed Color Texture Rendering with Palette in Fragment Shader not working
- GLSL Shader Draws Only Black Screen LWJGL
- Is this GLSL program correct? My cubes are solid black
- GLSL noise function on devices with no high precision fragment shader
- JMonkey Filter Shader - get World Position of Fragment
- Three.js, custom shader and png texture with transparency
- Threejs: make custom shader match the standard rendering
- SKShader to create parallax background
- Switching from 3D to 2D in OpenGL
- Getting exact pixel from texture
- Why is my texture mapping with my fragment shader generating lines at texture coordinate jumps?
- How to make the line color flat instead of gradient in OpengGL ES 2.0?
- WebGL: 2D Fragment Shader With Dynamic Data
- How to disable color interpolation in opengl es 2.0?
- Replace alpha for texture into the shader
Related Questions in VERTEX-SHADER
- Should Meshes with and without Skeleton use different Shaders?
- GLSL Shader Draws Only Black Screen LWJGL
- Create SpriteBatch throw IllegalArgumentException
- Overlaying a transparent color over a Texture with GLSL
- Three.js PointCloud vertices always return (0,0,0) position
- Save world transform for the same model in multiple pass rendering
- Switching from 3D to 2D in OpenGL
- What's wrong with my lighting function in the shader?
- How to make the line color flat instead of gradient in OpengGL ES 2.0?
- D3D11 Create Shader: Encoded Vertex Shader size doesn't match specified size
- Operations on complex numbers in vertex shader
- Is there a way to know how may vertices are processed by frame in WebGL?
- Issue using attributes object in RawShaderMaterial
- How to get accurate fragment screen position, like gl_FragCood in vertex shader?
- How fragment shader determines the number of fragments from vertex shader output?
Related Questions in STAGE3D
- Stage3D iOS Antialiasing on AIR 24
- Away3D Stage3DProxy drawing order
- Shadow-casting shaders in Stage3D
- Rendering all sprites to a texture or as separate quads?
- Drawing a sphere with quads
- How to share "Starling" game in a facebook feed
- Adding or combining Matrix3Ds
- Should a new VertexBuffer3D & IndexBuffer3D be created for each Program3D used?
- Can I use Adobe's "Stage3D" to improve the performance of my 2D applications and games?
- When using Context3DVertexBufferFormat.BYTES_4, what is the value range of one field?
- Can Adobe AIR for desktop run a Stage 3D project?
- Stage3D and AIR 3
- Can Matrices exist on vertex registers other than vertex constants in AGAL?
- Can constants (vertex or fragment) be reset / nullified in Context3D?
- How to define projection matrix in stage3d without using perspectiveFieldOfViewLH method
Related Questions in AGAL
- Shadow-casting shaders in Stage3D
- Is there a way to do bitwise-shift operations in AGAL?
- Can Matrices exist on vertex registers other than vertex constants in AGAL?
- How to draw a single-pixel width line in Stage3D
- How use Immediate number in AGAL
- how to implement the runtime compression of texture?
- what's the agal tex syntax?
- Why in AGAL have we a data32PerVertex with a max value of 64 in createVertexBuffer method?
- Inverting texture color with AGAL
- Pass position to fragment shader in AGAL
- how stage3d uv mapping work?
- How do I pass barycentric coordinates to an AGAL shader? (AGAL wireframe shader)
- AGAL: Calculating screen space position in fragment shader
- AGAL seq opcode works on hardware, but doesn't on software emulation (float number comparison is different on both?)
- Get current buffer depth in fragment shader in agal
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
IT's called Deferred shading, you have to do 2 pass of vertex and fragment shaders. In the first pass you accumulate informations about distances, normals, occlusion... In the second pass you render and apply the informations of the first pass to make shadows.
Another options is ShadowMapping:
Basic shadowmap
The basic shadowmap algorithm consists in two passes. First, the scene is rendered from the point of view of the light. Only the depth of each fragment is computed. Next, the scene is rendered as usual, but with an extra test to see it the current fragment is in the shadow.
The “being in the shadow” test is actually quite simple. If the current sample is further from the light than the shadowmap at the same point, this means that the scene contains an object that is closer to the light. In other words, the current fragment is in the shadow.