decal:add, decal:blend

Полезная литература, исходники шейдеров из серьезных игр и других движков, ссылки на тематические ресурсы - всё здесь.

decal:add, decal:blend

Сообщение gnoblin 21 фев 2011, 14:24

Вот что я спросил:
I'd like to know how to use decal:add \ decal:blend (the 2nd one is a new feature in 3.2) in a surface shader (and when is the appropriate situation to use these directives).

I've found decal:add in Terrain's AddPass.shader, but have no idea how to use this directive in my own shader.

There's a mention of them in the manual:
"decal:add - Additive decal shader (e.g. terrain AddPass).
decal:blend - Semitransparent decal shader."

But besides that I haven't found any useful info.


Вот что ответил Aras в бетагруппе:

decal:blend is for "decal" objects, i.e. semitransparent objects that lie on top of some other surface (think bullet/explosion marks, footsteps, graffiti etc.).

Using decal:blend makes it a bit different from a regular semitransparent shader because shadows will be received by the decal object, both in forward and deferred rendering. However, for that to work, some other regular opaque object needs to be just below the decal surface. See the attached picture; there's a regular plane and a smaller plane with a tiled particle texture on top; and that smaller plane is using shader with decal:blend. I attached a small package with this scene & shader.

No other regular use cases come to mind for this, except for terrain's additive pass :) Overall it's just like decal:blend, except the blending is additive. It also needs some other opaque surface to be beneath it for shadows to work.
У вас нет доступа для просмотра вложений в этом сообщении.
skypeid: madkust
Мои крайние проекты:
Убойный Хоккей
Cube Day Z (альфа)
Аватара пользователя
gnoblin
Адепт
 
Сообщения: 4633
Зарегистрирован: 08 окт 2008, 17:23
Откуда: Минск, Беларусь
Skype: madkust
  • Сайт

Re: decal:add, decal:blend

Сообщение Spike 21 фев 2011, 18:46

О деталях реализации декалей этим способа можно только догадываться.
Если поставить на сцену два источника то видны отличия в forward & deferred рендерах. (в шейдере стоит decal:blend)
Первое это не одинаковый блендинг, в форварде если подсвечивать подложку с тенью, другим источником света, то декаль не правильно блендится с тенью.
Второе почему в форвард рендере этот же плейн дает 2 DC, а в диференде 1 :). В обоих ренедерах тени не принимаются, а свет принимается только от одного источника(с самой большой интенсивностью).

test_decal_blend.jpg
У вас нет доступа для просмотра вложений в этом сообщении.
Spike
UNIт
 
Сообщения: 51
Зарегистрирован: 22 сен 2009, 22:40


Вернуться в Шейдерная школа

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 1