New render_script and constants

Hi! I’m sending constants to material using old render_script like that:

function init(self)
	self.tile = render.predicate({"tile"})
	self.constants = render.constant_buffer()
end

function update(self)
	render.draw(self.tile, {frustum = frustum, constants = self.constants})
end

And how can we now send constants to shaders with new render script?

function update(self)
	render.draw(predicates.tile, camera_world.frustum)
end

use something like that:

function update(self)
  camera_world.frustum.constants = self.constants -- it's not the best name for that table, yes
  render.draw(predicates.tile, camera_world.frustum)
end
3 Likes

Thank you

Ah yes, that name should be changed.

1 Like