Anyone experimented already with adding shadows to Illumination? It would be so better!
I am trying to investigate @jhonny.goranssonShadow Mapping example, but can’t figure out yet how to merge it into Illumination example, so any advises would be gold!
Shadow mapping example has one light source, while in illumination there could be many, so those are probably not compatible out of the box
Their order in the editor is now sorted by alphabet instead of the sequential order from the source file as it was before. But it also affects calls like go.get('textureN'), where N now depends on the alphabet.
So I changed texture1 to texture0 to fix the bug (DATA_TEXTURE was 2th before 1.6.3), but the dependence of the N on the alphabet looks a little flimsy…
Is it okay? Or may be there is a new way to get texture path by sampler name? My use case:
local TEXTURE_DATA = hash 'texture0'
local data_url = msg.url('#data') -- #data is mesh component
...
data_texture_path = go.get(data_url, TEXTURE_DATA)
resource.set_texture(data_texture_path, data_texture_header, data_buffer)
I think that for meshes you should be able to get a texture by the sampler name if that’s how we save the texture mappings these days… we really don’t want resources to depend on indexing like this
Only go.get(data_url, hash 'textureN') works at the moment . Or should I try something else?
go.get(data_url, hash 'DATA_TEXTURE')
>>>
ERROR:SCRIPT: illumination/illumination.lua:309: '/illumination#data' does not have any property called 'DATA_TEXTURE'
No it’s the only one that works, I’m just saying as a note for myself that we should probably allow setting textures by sample name at some point but for now that’s the only way to do it