zoukankan      html  css  js  c++  java
  • ue渲染列表

    scenevisibility.cpp

    MarkRelevant()

    逐个primitive 加到 分属于各个pass的渲染list

    ComputeDynamicMeshRelevance()

    NumElements = MeshBatch.Mesh->Elements.Num();

    每个pass里elements数量更新

     

    MobileBasePass.cpp

    FMobileBasePassMeshProcessor::Process()

    定义回调

    meshBatch

    FMeshPassProcessor postprocess前面各个pass继承这个processor有自己的rendering

     

    MobileShadingRenderer.cpp

    SetupMobileBasePassAfterShadowInit()

    添加回调

     

    总的结构

    renderer里 排布各个pass

    pass用的数据来自meshPassProcessor  (FCustomDepthPassMeshProcessor)

    xxRendering里(或者setup)定义processor addMeshBatch,用父类meshPassProcessor.addMeshBatch 

    它们被renderer的render()调用 位于renderer这层 物理位置在rendering.cpp

     

    FPrimitiveViewRelevance

     

    FPrimitiveSceneProxy::FPrimitiveSceneProxy(const UPrimitiveComponent* InComponent, FName InResourceName)

    , bCastVolumetricTranslucentShadow(InComponent->bCastDynamicShadow && InComponent->CastShadow && InComponent->bCastVolumetricTranslucentShadow)

     

    if (MeshBatch.CastShadow)
    	{
    		// Determine the mesh's material and blend mode.
    		const FMaterialRenderProxy* FallbackMaterialRenderProxyPtr = nullptr;
    		const FMaterial& Material = MeshBatch.MaterialRenderProxy->GetMaterialWithFallback(FeatureLevel, FallbackMaterialRenderProxyPtr);
    		const FMaterialRenderProxy& MaterialRenderProxy = FallbackMaterialRenderProxyPtr ? *FallbackMaterialRenderProxyPtr : *MeshBatch.MaterialRenderProxy;
    
    		const EBlendMode BlendMode = Material.GetBlendMode();
    		const float MaterialTranslucentShadowStartOffset = Material.GetTranslucentShadowStartOffset();
    		const FMeshDrawingPolicyOverrideSettings OverrideSettings = ComputeMeshOverrideSettings(MeshBatch);
    		const ERasterizerFillMode MeshFillMode = ComputeMeshFillMode(MeshBatch, Material, OverrideSettings);
    		const ERasterizerCullMode MeshCullMode = ComputeMeshCullMode(MeshBatch, Material, OverrideSettings);
    		const bool bIsTranslucent = IsTranslucentBlendMode(BlendMode);
    

      开关数据放在material里 用这种方式拿到

      还可以放component 作用于整个mesh的数据 

     

    设置pass rt

    BeginRenderPass

  • 相关阅读:
    Graceful degradation versus progressive enhancement
    表现与数据分离
    避免写出IE Bug
    js控制元素的显示与隐藏
    EntityManager方法简介
    JPA EntityManager详解(一)
    Springmvc中 同步/异步请求参数的传递以及数据的返回
    JPA详解
    单向关系中的JoinColumn
    Hibernate一对多和多对一关系详解 (转载)
  • 原文地址:https://www.cnblogs.com/minggoddess/p/14251028.html
Copyright © 2011-2022 走看看