mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
Remove some format rule (#10919)
* remove some rules * format all codes with new format rule
This commit is contained in:
@@ -45,10 +45,10 @@ namespace pipeline {
|
||||
|
||||
ShadowMapBatchedQueue::ShadowMapBatchedQueue(RenderPipeline *pipeline)
|
||||
: _phaseID(getPhaseID("shadow-caster")) {
|
||||
_pipeline = pipeline;
|
||||
_buffer = pipeline->getDescriptorSet()->getBuffer(UBOShadow::BINDING);
|
||||
_pipeline = pipeline;
|
||||
_buffer = pipeline->getDescriptorSet()->getBuffer(UBOShadow::BINDING);
|
||||
_instancedQueue = ccnew RenderInstancedQueue;
|
||||
_batchedQueue = ccnew RenderBatchedQueue;
|
||||
_batchedQueue = ccnew RenderBatchedQueue;
|
||||
}
|
||||
|
||||
ShadowMapBatchedQueue::~ShadowMapBatchedQueue() = default;
|
||||
@@ -56,10 +56,10 @@ ShadowMapBatchedQueue::~ShadowMapBatchedQueue() = default;
|
||||
void ShadowMapBatchedQueue::gatherLightPasses(const scene::Camera *camera, const scene::Light *light, gfx::CommandBuffer *cmdBuffer) {
|
||||
clear();
|
||||
|
||||
const PipelineSceneData *sceneData = _pipeline->getPipelineSceneData();
|
||||
const scene::Shadows * shadowInfo = sceneData->getShadows();
|
||||
const PipelineSceneData *sceneData = _pipeline->getPipelineSceneData();
|
||||
const scene::Shadows *shadowInfo = sceneData->getShadows();
|
||||
if (light && shadowInfo->isEnabled() && shadowInfo->getType() == scene::ShadowType::SHADOW_MAP) {
|
||||
const RenderObjectList &dirShadowObjects = sceneData->getDirShadowObjects();
|
||||
const RenderObjectList &dirShadowObjects = sceneData->getDirShadowObjects();
|
||||
const RenderObjectList &castShadowObjects = sceneData->isCastShadowObjects();
|
||||
switch (light->getType()) {
|
||||
case scene::LightType::DIRECTIONAL: {
|
||||
@@ -70,11 +70,11 @@ void ShadowMapBatchedQueue::gatherLightPasses(const scene::Camera *camera, const
|
||||
} break;
|
||||
|
||||
case scene::LightType::SPOT: {
|
||||
const auto *spotLight = static_cast<const scene::SpotLight *>(light);
|
||||
const Mat4 matShadowView = light->getNode()->getWorldMatrix().getInversed();
|
||||
Mat4 matShadowProj;
|
||||
const auto *spotLight = static_cast<const scene::SpotLight *>(light);
|
||||
const Mat4 matShadowView = light->getNode()->getWorldMatrix().getInversed();
|
||||
Mat4 matShadowProj;
|
||||
Mat4::createPerspective(spotLight->getSpotAngle(), spotLight->getAspect(), 0.001F, spotLight->getRange(), &matShadowProj);
|
||||
const Mat4 matShadowViewProj = matShadowProj * matShadowView;
|
||||
const Mat4 matShadowViewProj = matShadowProj * matShadowView;
|
||||
geometry::AABB ab;
|
||||
for (const auto ro : castShadowObjects) {
|
||||
const auto *model = ro.model;
|
||||
@@ -122,8 +122,8 @@ void ShadowMapBatchedQueue::add(const scene::Model *model) {
|
||||
}
|
||||
|
||||
for (const auto &subModel : model->getSubModels()) {
|
||||
const auto *pass = subModel->getPass(shadowPassIdx);
|
||||
const auto batchingScheme = pass->getBatchingScheme();
|
||||
const auto *pass = subModel->getPass(shadowPassIdx);
|
||||
const auto batchingScheme = pass->getBatchingScheme();
|
||||
|
||||
if (batchingScheme == scene::BatchingSchemes::INSTANCING) {
|
||||
auto *instancedBuffer = InstancedBuffer::get(subModel->getPass(shadowPassIdx));
|
||||
@@ -147,10 +147,10 @@ void ShadowMapBatchedQueue::recordCommandBuffer(gfx::Device *device, gfx::Render
|
||||
|
||||
for (size_t i = 0; i < _subModels.size(); i++) {
|
||||
const auto *const subModel = _subModels[i];
|
||||
auto *const shader = _shaders[i];
|
||||
const auto * pass = _passes[i];
|
||||
auto *const ia = subModel->getInputAssembler();
|
||||
auto *const pso = PipelineStateManager::getOrCreatePipelineState(pass, shader, ia, renderPass);
|
||||
auto *const shader = _shaders[i];
|
||||
const auto *pass = _passes[i];
|
||||
auto *const ia = subModel->getInputAssembler();
|
||||
auto *const pso = PipelineStateManager::getOrCreatePipelineState(pass, shader, ia, renderPass);
|
||||
|
||||
cmdBuffer->bindPipelineState(pso);
|
||||
cmdBuffer->bindDescriptorSet(materialSet, pass->getDescriptorSet());
|
||||
|
||||
Reference in New Issue
Block a user