BlueHarrier
Member
Hi again, community.
Today I'm having issues with surfaces and Multi Render Targets, in this case, the game just crashes when trying to set the second target slot twice (reseting the target in between, obviously), and I don't know why. For some reason (and it's not the first time this happens to me), the game doesn't crash when using the debugger, but the application surface becomes completely white.
This is the fragment where it crashes (Draw End):
And the error given is:
This problem only occurs when there are TWO or more instances of this object in the room, when there's only one, there is no problem. Any ideas of what could it be?
Today I'm having issues with surfaces and Multi Render Targets, in this case, the game just crashes when trying to set the second target slot twice (reseting the target in between, obviously), and I don't know why. For some reason (and it's not the first time this happens to me), the game doesn't crash when using the debugger, but the application surface becomes completely white.
This is the fragment where it crashes (Draw End):
Code:
var
mat=matrix_build(x, y, z, 0, 0, 0, 2, 2, 2);
matrix_set(matrix_world, mat)
gpu_set_cullmode(cull_clockwise)
shader_set(sh3d_lightsource)
var
rel_uv=shader_get_uniform(sh3d_lightsource, "u_RelTexCoords"),
z_vals=shader_get_uniform(sh3d_lightsource, "u_ZVals"),
ul_color=shader_get_uniform(sh3d_lightsource, "u_LightColor"),
brightness=shader_get_uniform(sh3d_lightsource, "u_LightBrightness");
shader_set_uniform_f_array(rel_uv, sprite_get_uvs(tex_lamp, 0))
shader_set_uniform_f(z_vals, camera.z_near, camera.z_far)
shader_set_uniform_f(ul_color, color_get_red(l_color)/255, color_get_green(l_color)/255, color_get_blue(l_color)/255)
shader_set_uniform_f(brightness, 0.5)
surface_set_target_ext(0, application_surface)
surface_set_target_ext(1, global.light_surf)
camera_reload()
model_draw("lamp.dat", tex_lamp, 0)
surface_reset_target()
shader_reset()
gpu_set_cullmode(cull_noculling)
matrix_set(matrix_world, matrix_build_identity())
Code:
############################################################################################
ERROR in
action number 1
of Create Event
for object obj_light:
Cannot free this surface - call surface_reset_target before calling surface_free
############################################################################################
Last edited: