具体的directlighting包括⽣成shadow过程

具体的directlighting包括⽣成shadow过程:
1BuildCardsUpdateList 从对应的lumencards以及cardspage列表去,分别根据direct和indirectlight 去做⼀次
2…PriorityHistogram更新。也就是根据对应cardpagebuffer⾥的第⼀个vector(5个为⼀张cardpage)的第⼀个vector的zw,也就
是texelsize 相乘 /64得到多少个tile,再原⼦操作累加起来。
3.SelectMaxUpdateBucketCS:
Dispatch对应direct和indirect。 然后根据预设的最⼤的maxtile
const FIntPoint UpdateAtlasSizeInTiles = UpdateAtlasSize / Lumen::CardTileSize;
Context.MaxUpdateTiles = UpdateAtlasSizeInTiles.X * UpdateAtlasSizeInTiles.Y;

其实就是获得需要更新的tile总数。
4.build cards update list
Dispatch是:NumCardPage数量/64, 说⽩了64个page⼀组. 以thread.x(64)为基础,获得对应的cardpage以及对应的
cardpagetile数量。将cardpage数量存⼊对应的direct和indirect的allocator,在对应的地⽅存⼊对应的指代cardpage具体index的
关系。
5.SetCardPageIndexIndirectArgs
// FRHIDrawIndirectParameters
RWDirectLightingDrawCardPageIndicesIndirectArgs[0] = VertexCountPerInstanceIndirec
RWDirectLightingDrawCardPageIndicesIndirectArgs[1] = NumPageIndices;
RWDirectLightingDrawCardPageIndicesIndirectArgs[2] = 0;
RWDirectLightingDrawCardPageIndicesIndirectArgs[3] = 0;
// Thread per page
RWDirectLightingDispatchCardPageIndicesIndirectArgs[0] = (NumPageIndices + 63) / 6
RWDirectLightingDispatchCardPageIndicesIndirectArgs[1] = 1;
RWDirectLightingDispatchCardPageIndicesIndirectArgs[2] = 1;
// Thread per tile
RWDirectLightingDispatchCardPageIndicesIndirectArgs[3 + 0] = 4 * NumPageIndices;
RWDirectLightingDispatchCardPageIndicesIndirectArgs[3 + 1] = 1;
RWDirectLightingDispatchCardPageIndicesIndirectArgs[3 + 2] = 1;
具体参数设置在这。
后续就是cuttile:
6.SpliceCardPagesIntoTiles;
DispatchID: 4 * NumPageIndices

  • Splice card pages into N card tiles
    将groupid/4后,去对应的cardpageindexdata获取对应的cardpageindex
    然后将cardpage的sizeintexles/CARD_TILE_SIZE,因为这⾥/8了,所以前⾯⼀个判断具体coord的地⽅也要/8.最后⽣成tile。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值