GMS 2.3+ Surface draw error, working as intended so can I ignore?

White_tea

Member
So basically I'm trying to make a surface draw a view when the player is near the top / bottom of the level, making it look seamless (kind of).
This pic might explain better, I've drawn the surface in grey :
20201129_000044.jpg
The code I wrote seems to do the job but I'm getting the error message :
" Trying to set texture that is also bound as depth buffer - bailing... " This happens every step when my player is in range and the surface is triggered to draw.

does anyone know what this means? and is it safe to ignore?

I came across this post and have tried some of the troubleshooting suggested but still cant shake the error.
I'm struggling to find what could be wrong with my code as it seemed quite basic but will post here to make sure I've not missed something silly,

for reference this is only for the bottom surface as the top is pretty much the same, I have set up view_port[1] in the room editor and set surface_bottom = -1 in the create event

DRAW EVENT
GML:
/// trigger and fade surfaces
    if surface_trigger_bottom {
            surf_alpha = lerp(surf_alpha,1,0.03)
        }else{
             if surf_alpha !=0{
                surf_alpha = lerp(surf_alpha,0,0.03)
             }
        }

if !surface_exists(surf_bottom) { 
    surf_bottom = surface_create(surf_w,surf_h)
    view_surface_id[1] = surf_bottom
    } else {
        if surf_alpha!=0{ 
            view_visible[1] = true
            draw_surface_ext(surf_bottom,0,rm_bottom,1,1,0,c_dkgray,surf_alpha)
      
        }else{
            view_visible[1] = false
        }
    }
 
Last edited:
Top