Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

I'm having issues with getting this working in my project, and wondered if there was something obvious that I missed?

When using any of the lighting options, it also draws light in the distance:

If I use fog, it stops drawing the floor:

It doesn't matter how close or far I draw the fog. This is the code I'm using in the draw event:

draw_clear(c_black);

var _ztilt = lengthdir_y(1, tilt);

var _lookz = z + _ztilt;

var _zmult = 1 - abs(_ztilt);

var _lookx = x + lengthdir_x(1, direction) * _zmult;

var _looky = y + lengthdir_y(1, direction) * _zmult;

view_mat = matrix_build_lookat(x, y, z, _lookx, _looky, _lookz, 0, 0, -1);

camera_set_view_mat(cam, view_mat);

gpu_set_ztestenable(true);

gpu_set_zwriteenable(true);

cluck_set_fog(true, #000000, 1, 320, 640);

cluck_set_light_ambient(c_black);

cluck_set_light_point(1, #EEAAFF, x, y, 160, 640);

cluck_apply(shd_cluck_fragment);

draw_3d_objects();

gpu_set_ztestenable(false);

gpu_set_zwriteenable(false);

gpu_set_cullmode(cull_noculling);

shader_reset();

Someone else ran into the lighting problem a few days ago, there seems to be something wrong with the specular reflection code that’s making the highlights appear in the wrong direction. For now if you disable that with cluck_set_spec_strength(0) it should work, I’m going to try to find out why it’s doing that.

For the fog, I’ve never seen that before. Can you send me a copy of the project?

That fixed it, thanks - I can send the project no problem, where would you like me to send it?

(+1)

If you have a github repository you can send me the link or that, otherwise you can throw it on a google drive and send it to me here, or on bluesky or something if you don’t want the link open to the public

I've not set up a repo so I'll put it on drive and dm you on bluesky (just added you - I'm this guy https://bsky.app/profile/flashmoth.bsky.social )