Size: a a a

pro.graphon (and gamedev)

2020 March 04

AM

Aleksey Muravev in pro.graphon (and gamedev)
Не дискарди
источник

k

koren in pro.graphon (and gamedev)
Я и спрашиваю почему нет
источник

AM

Aleksey Muravev in pro.graphon (and gamedev)
koren
Я и спрашиваю почему нет
Это дорого для gpu
источник

AM

Aleksey Muravev in pro.graphon (and gamedev)
Варпы и все дела
источник

AM

Aleksey Muravev in pro.graphon (and gamedev)
Можно стенсил оп для фронт и бэк фейсов разный выставить.
источник

S

Sergey in pro.graphon (and gamedev)
Aleksey Muravev
Это дорого для gpu
А чем дорого? Только тем, что если не весь варп дискарднул, то все в варпе будут ждать тех, кто досчитывает до конца?
источник

TG

Timur Gagiev in pro.graphon (and gamedev)
Sergey
А чем дорого? Только тем, что если не весь варп дискарднул, то все в варпе будут ждать тех, кто досчитывает до конца?
early z отвалится, а мобилки вообще умрут
источник

eb

ed braed in pro.graphon (and gamedev)
Sergey
Да, действительно.

Я думал про свой кейс, там через полигоны видно много далёких источников, и камера почти никогда не бывает внутри сферы.
Т.е. сферы проблему не решают?
источник

k

koren in pro.graphon (and gamedev)
Timur Gagiev
early z отвалится, а мобилки вообще умрут
Мобилки умрут?
источник

TG

Timur Gagiev in pro.graphon (and gamedev)
koren
Мобилки умрут?
там растеризация отличается концептуально
источник

VK

Vitaliy ◀️TriΔng3l▶️ Kuzmin in pro.graphon (and gamedev)
ох, была бы операция stencil fail, depth pass…
источник

TG

Timur Gagiev in pro.graphon (and gamedev)
Vitaliy ◀️TriΔng3l▶️ Kuzmin
ох, была бы операция stencil fail, depth pass…
так zpass есть ведь
источник

VK

Vitaliy ◀️TriΔng3l▶️ Kuzmin in pro.graphon (and gamedev)
Timur Gagiev
так zpass есть ведь
Просто думал, как и бэкфейсы, и фронтфейсы всех сфер запихнуть в один DrawInstanced, и при этом использовать только один бит стенсила (после каждой сферы его возвращать в исходное состояние)
источник

S

Sergey in pro.graphon (and gamedev)
ed braed
Т.е. сферы проблему не решают?
Всмысле, то что они выпуклые?
В моём случае проблема в том, что мы рендерим сферы с обратным z-тестом. Если делать это напрямую один раз, то мы считаем вклад источника для фрагментов между камерой и сферой, который оказывается нулевым.
===я сейчас нахожусь здесь===
и хочу побороть проблему отдельным проходом, которой что-то запишет в depth buffer и/или 1 бит стенсила.
источник

TG

Timur Gagiev in pro.graphon (and gamedev)
@mrshoor как-то кидал статью, но там надо глубину переключать
источник

VK

Vitaliy ◀️TriΔng3l▶️ Kuzmin in pro.graphon (and gamedev)
И при этом чтобы не запускался пиксельный шейдер вообще для тех фейсов, которые используются чисто для каллинга
источник

AM

Aleksey Muravev in pro.graphon (and gamedev)
Render the objects as usual into the G buffer so that the depth buffer will be properly populated.

Disable writing into the depth buffer. From now on we want it to be read-only

Disable back face culling. We want the rasterizer to process all polygons of the sphere.

Set the stencil test to always succeed. What we really care about is the stencil operation.

Configure the stencil operation for the back facing polygons to increment the value in the stencil buffer when the depth test fails but to keep it unchanged when either depth test or stencil test succeed.

Configure the stencil operation for the front facing polygons to decrement the value in the stencil buffer when the depth test fails but to keep it unchanged when either depth test or stencil test succeed.

Render the light sphere.
источник

AM

Aleksey Muravev in pro.graphon (and gamedev)
Разве нет?
источник

VK

Vitaliy ◀️TriΔng3l▶️ Kuzmin in pro.graphon (and gamedev)
Aleksey Muravev
Render the objects as usual into the G buffer so that the depth buffer will be properly populated.

Disable writing into the depth buffer. From now on we want it to be read-only

Disable back face culling. We want the rasterizer to process all polygons of the sphere.

Set the stencil test to always succeed. What we really care about is the stencil operation.

Configure the stencil operation for the back facing polygons to increment the value in the stencil buffer when the depth test fails but to keep it unchanged when either depth test or stencil test succeed.

Configure the stencil operation for the front facing polygons to decrement the value in the stencil buffer when the depth test fails but to keep it unchanged when either depth test or stencil test succeed.

Render the light sphere.
В таком случае однозначно в 0 вернётся после каждой сферы? Если да, то норм
источник

AM

Aleksey Muravev in pro.graphon (and gamedev)
Vitaliy ◀️TriΔng3l▶️ Kuzmin
В таком случае однозначно в 0 вернётся после каждой сферы? Если да, то норм
Зона внутри сферы будет в 1
источник