Skip to content

Commit

Permalink
update mem_texture state
Browse files Browse the repository at this point in the history
  • Loading branch information
pourtheworld committed Mar 11, 2024
1 parent 51db49b commit 306e3bf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/ant.render/mem_texture/mem_texture_common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function m.copy_main_material()
local fm = e.filter_material
local matres = assetmgr.resource(e.material)
local Dmi = fm.DEFAULT_MATERIAL
local newstate = irender.create_depth_state(Dmi:get_state())
local newstate = irender.create_write_state(Dmi:get_state())
if newstate then
local mi = RM.create_instance(matres.object)
mi:set_state(newstate)
Expand Down
9 changes: 9 additions & 0 deletions pkg/ant.render/render.lua
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,15 @@ function irender.create_depth_state(os)
end
end

function irender.create_write_state(os)
local s = irender.has_depth_test(os)
if s and not s.BLEND then
s.DEPTH_TEST = "GREATER"
s.WRITE_MASK = "RGBAZ"
return bgfx.make_state(s)
end
end

function irender.group_flush(go)
go:flush()
go:filter("render_object_visible", "render_object")
Expand Down

0 comments on commit 306e3bf

Please sign in to comment.