Thx!
Mr.Pinky
Recent community posts
Hello! I have a strange problem: the shadow is drawn on top of the sprite, not underneath, as in the demo.
CREATE:
// Shadow
_shadow = new Crystal_ShadowSprite(id, sprite_index, image_index, CRYSTAL_SHADOW.DYNAMIC);
_shadow.shadowLength = 0.1; // Numbers close to 0 will prevent the shadow from moving too much with the light. 1 = same distance as the light.
_shadow.fixedBase = false; // The shadow WILL offset
_shadow.followLightAngle = false; // The shadow will NOT rotate based on the light position
_shadow.Apply();
STEP:
//Shadow x/y/depth
_shadow.x = x;
_shadow.y = y;
_shadow.depth = depth + 1;
UPDATE: Sorry! My fault: gpu_set_ztestenable(true);
// 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);

