Need something clarified about using the lumiere shaders

tile and particle predicates are drawn twice, once here:

render.set_projection(get_projection(self))
render.draw(self.tile_pred)
render.draw(self.particle_pred)
render.draw_debug3d()
-- render GUI

and second time in Lumiere function:

lumiere.draw(function()
	local frustum = self.projection * self.view
	render.draw(self.tile_pred, { frustum = frustum })
	render.draw(self.particle_pred, { frustum = frustum })
end)

Only second one is affected by Lumiere, but is drawn on top of not cleared screen. I don’t think it was wanted approach?

If lights is the only think you want you could either follow my video: How to make Simple Lighting in Defold? Screen Space Light Maps! #gamedev #tutorial #indiedev - YouTube with source code here: https://github.com/paweljarosz/unfolding_simple_lighting. The same is also explained in an official example: publicexamples/examples/simple_lights at master · britzl/publicexamples · GitHub

This aprroach is drawing to separate render targets (internal buffers / textures) and then drawing them mixed on top of a quad that is filling the full screen - maybe it would be easier for you? It is a raw Defold API based render scipt and I believe it is best to learn it. Then all the full screen post processing is done in the fragment program (shader) of the quad - you can then add here effects from lumiere or other sources.

1 Like

good news! the lights are working, bad news

I got this result by commenting out the first set of render.draw(self ect)

Its hard to tell as an image, but its one of those frame smear glitches where each previous action gets imprinted onto the background

also all the foreground sprites are gone

I assume the last frame is now no longer clearing when drawing the next frame is drawn, but Idk how to fix this

My suggestion is that you copy the example.render_script from Lumiere to your own project. The example render script works (verify this by running the example project!).

Hmm, looks like definitely lacking clearing the screen every update (because I guess, you made a screenshot after a while of moving around, right?). One call to clear is here. Check if the raw render script from Lumiere works, as @britzl suggested for now. If it will not work, then there is something with materials.

The screen just ends up black with the gui drawn on top

I have not touched the materials or vp’s I imported the files directly

:point_up_2:

1 Like