Skip to main content

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

Strange problem, I create a normal material (in the example when I insert everything works ok), and my normal map does not work when lighting... I've racked my brains and can't find the problem...

material = new Crystal_Material(id);

material.normalSprite = spr_floor_s04_n_1;

material.Apply();

// Create system responsible for rendering lights, shadows, materials, etc.

renderer = new Crystal_Renderer();

renderer.SetRenderEnable(true);

renderer.SetDrawEnable(true); // disable it if using post processing

renderer.SetMaterialsEnable(true);

renderer.SetHDREnable(true);

renderer.SetCullingEnable(true);

renderer.SetCullingSettings(300);

renderer.SetLightsBlendmode(CRYSTAL_LIGHTS_BLENDMODE.MULTIPLY);

renderer.SetAmbientColor(c_black);

renderer.SetAmbientIntensity(0);

// Enable depth buffer and alpha test

gpu_set_zwriteenable(true);

gpu_set_ztestenable(true);

gpu_set_alphatestenable(true);

gpu_set_alphatestref(1);

application_surface_draw_enable(false);

(1 edit)

Hello!

You can only see materials if the light's shader is Phong or BRDF. By default, the light's shader is Basic. Also, take a look here.

I hope this helps :)