Zlib2000 instant Lighting

Source: Internet
Author: User
Zlib? This is not the same as the zlib of ZIP :)

This is the bottom layer of a game we created in 99 years,

Real-time light and shadows, to see what diablo2 thinks, for each character, add the Z axis information, so that the brightness can be calculated through the X, Y, Z coordinates, real light and shade Effects

As shown in the figure, it is the most prominent part of the skirt, Which is minimized by the light below.

The following is the description at the time:

Demonstration of light and shadow Based on Z buffer

Zip package 67 K

Direction keys and ESC keys

This is the second demonstration of the Z buffer-based light and shadow demonstration I wrote, mainly to achieve the effect of Diablo II, which is the most basic use of Z buffer.

It is not very different from the previous one.

At present, such as multi-light source, multi-color light (the color of each light source is different) can basically be achieved, but there are still some bugs, so it has not been taken out; how to do it is basically understood, although it is not the same as what I originally imagined, there should be no major problems.

I'm afraid I have no time to write it over the past few days. Let's talk about it later.

The code used to process the Z buffer is written in C, and the square sum of squares is simply calculated using the lookup table. There should be room for significant optimization.

In fact, there are still many areas that I think cannot be solved. For example, a high chair back should block part of the light, but it cannot be implemented at present. It will consume resources if it is divided into two parts, in addition, such a small place is not cost-effective. Fortunately, this kind of stuff may not be used in actual use.

I hope to discuss it with you!

We are particularly grateful for the RLA decoding Code provided by Yunfeng.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.