As part of the ongoing jam, I prepared an asset that includes a pack of shaders, materials and scripts for creating a 3D/2.5D game with shadows and light.
Just a note, seems like this might be broken in Defold 1.6.4 - Console comes up with hundreds of ‘tex1 cannot be empty’ for each of the game objects. Setting it to anything that exists (builtin/particle blob) does seem to work though, not sure of the side effects of doing so.
There are no any side effects. The second texture sampler remapped in a render script to a shadowmap render target, so no matter what the field contains in the editor.
btw the example updated to supporting Defold v 1.7.0
I would like to use this lib with Vulkan(for metal on macos) but it fails. It seems like a shader problem( user(locn2)) but can’t understand it. Any idea why?
[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Render pipeline compile failed (Error code 3):
Fragment input(s) `user(locn2)` mismatching vertex shader output type(s) or not written by vertex shader.
ERROR:GRAPHICS: Vulkan Error (../src/vulkan/graphics_vulkan.cpp:1540) VK_ERROR_INITIALIZATION_FAILED
Assertion failed: (0), function GetOrCreatePipeline, file graphics_vulkan.cpp, line 1540.
I’m using 1.7.
flickering happens when using @jhonny.goransson 's examples with Vulkan too. I solve the issue on his libs by using local vertex space for static(without skeleton or animation) models. But of course I have no idea about the actual issue here.
I found (and fixed) a flickering issue with vulkan when using render targets this week. Let me take a look at this example as well and make sure it works my plan is to make vulkan the default renderer for osx very soon, so I need to squash every bug I can find!
Cheers, I have something small to work with now. It’s definitely something wrong with the shaders, but I need to make it a bit more robust - it should work the same as opengl