dai.yuqi Posted May 6, 2013 Share Posted May 6, 2013 When I add a plane to the world, I gave a texture with alpha channel and open alpha Test. This plane becomes transparent, but can not see the receiving shadow. If I want to make like this transparent material to receive shadows, how to create a material or create shader? Thanks. Link to comment
dai.yuqi Posted May 6, 2013 Author Share Posted May 6, 2013 The material is very useful when doing AR Project。 The shadow of AR ground can make more real.My solution is: 1 .Create a plane added to the world. 2. Inherited of this material mesh_base and modify Blending src = one minus src alpha , the Blending dest = dest Color. 3. Set the color = (0.5f, 0.5f, 0.5f, 1.0f); 4. Then make this plane as a floor receiving shadow. However, due to this plane is semitransparent and gray, Obscured background color reproduction is very low. So I need a better solution at present. Thanks a lot. Link to comment
nat.harrold Posted May 6, 2013 Share Posted May 6, 2013 I was going to post a similar question today. I was surprised and happy to see your post. As several people / companies are working on an Augmented Reality solution for Unigine, it would be worthwhile discussing some of the shader requirements. matte_shadow --> shadow receive matte_reflection --> planar reflection receive matte_mask --> mask objects + shadow and reflection receive 1 & 2 are fairly self explanatory 3. This is for more specific application, where an installation would be permanently fixed and masking of objects would be required for overlaying unigine onto a more complex and occludable models; (which could open the way for some insanely cool installations). For a simple example of use, a set of extruded blocks on a table exist in reality and an exact dimensioned, tracked and matched geometry version existed in unigine. The mesh in unigine could be used as the mask / matte object required to perform the masking on the AR result and thus performing the correct masking of physical version. Shaders are not my skill, but I think it would involve the stencil & depth buffers (for shadow and reflection) and perhaps the auxillary buffer for masking All ideas and suggestions welcome. Link to comment
frustum Posted September 23, 2013 Share Posted September 23, 2013 It will be possible to achieve that in the next SDK update. The following settings are required: * Render HDR must be disabled. * Material blending mode set to zero:src_color. * All material rendering passes are disabled except light. * White diffuse texture on transparent material. Link to comment
snow_zhangy Posted September 26, 2013 Share Posted September 26, 2013 That's great!! thanks frustum! Link to comment
Recommended Posts