Light and Shadows example

Ok, it’s working better now, this is vulkan:

I copied the varying specification from the vertex shader to the fragment shader. So now I just need to figure out if we can catch this early, or avoid it happening. Thanks for the report!

5 Likes

There are some build errors for simple_input.lua
Line 56: registered_node[node] = nil
‘Undefined global registered_node’
These don’t stop it ‘working’ though, so I guess it is no big deal.
(tag: v0.4.0,e8222cd)

1 Like

yep, should be ‘registered_nodes’, I’ve fixed this typo mistake. Thanks.

4 Likes

I have a small question. How can you make it so that an object can cast a shadow - but the shadow does not fall on it?

normal

i wont use this code for show GO “robot2” to front

    render.disable_state(render.STATE_DEPTH_TEST)
    render.draw(self.robot1, frustum)
    render.draw(self.robot2, frustum)
    render.enable_state(render.STATE_DEPTH_TEST)

but shadow continue cast from bihind robot ((

Objects that cast a shadow must have the second tag ‘shadow’ in their material.

Sorting when casting shadows is by Z (in view coordinates), if you introduce your own sorting of objects in the render script in the following, you should take this into account for casting shadows as well.

Thank you for your answer. Yes, now I use z sorting - but it’s not pretty (( All my characters are on the same line and the offset along the z axis is immediately visible

That’s why I want to do sorting in render