Blog

Around GPU Gems, часть 1, глава 1. Эффективное моделирование воды на основе физических моделей

Автор оригинала: Марк Финч, Cyan Worlds Inc.

Эта статья описывает подход к моделированию и рендерингу больших массивов воды на GPU. Подход комбинирует геометрические преобразования исходной триангуляции с динамической генерацией карт нормалей. Данный подход применялся в игре Uru: Ages Beyond Mist от Cyan Worlds.

Тихий омут

Add a comment

Read more: Around GPU Gems, часть 1, глава 1. Эффективное моделирование воды на основе физических моделей

Python Metaclasses

(There is an awesome post explaining the same thing at StackOverflow; I'll try to make in shorter and more interesting.)

Why is C++ crappy as hell while Python is shining like a crown of the British Empire? Both are designed to be object-oriented languages, but the Python is the only true one. Everything in Python are objects. Literally, everything. Integers are objects, modules are objects and even object types are objects too.

Objects have constuctors. So object types have constructors too.

The built-in object-type constructor is named type and works like

mytype = type("MyTypeName", (parent1,), {'method1': lambda self: return None})

So, it takes name of the new type, tuple of parent types and dictionary of methods. That's enough to construct any class.

Yeah, it is THAT simple in Python.

type is also a class, and any standard type in Python is an instance of this class. So why not to subclass it?

Add a comment

Read more: Python Metaclasses

About

Hi!

This is a personal blog of Tigran Saluev devoted to computer graphics and related problems.

I'm a programmer from Russia, so you may imagine me like this:

A Russian Programmer at Work

Although actually I look like this.

Russian Programmer (actual)

I'm going to spend a lot of time working on this site, since the computer graphics is one of my very favorite subjects in computer science. In particular, I'm going to post here some translations of GPU Gems to Russian language and also some working Python code for demos.

Add a comment