惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Help Net Security
Help Net Security
Latest news
Latest news
G
GRAHAM CLULEY
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
The Exploit Database - CXSecurity.com
WordPress大学
WordPress大学
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
U
Unit 42
人人都是产品经理
人人都是产品经理
小众软件
小众软件
Microsoft Security Blog
Microsoft Security Blog
C
CERT Recently Published Vulnerability Notes
V
Vulnerabilities – Threatpost
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
NISL@THU
NISL@THU
AWS News Blog
AWS News Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
C
Cisco Blogs
Google DeepMind News
Google DeepMind News
阮一峰的网络日志
阮一峰的网络日志
Project Zero
Project Zero
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Know Your Adversary
Know Your Adversary
Cyberwarzone
Cyberwarzone
Y
Y Combinator Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
L
LINUX DO - 热门话题
The Hacker News
The Hacker News
Application and Cybersecurity Blog
Application and Cybersecurity Blog
GbyAI
GbyAI
酷 壳 – CoolShell
酷 壳 – CoolShell
Blog — PlanetScale
Blog — PlanetScale
T
Threat Research - Cisco Blogs
The GitHub Blog
The GitHub Blog
N
News and Events Feed by Topic
N
News | PayPal Newsroom
Attack and Defense Labs
Attack and Defense Labs
Cloudbric
Cloudbric
Scott Helme
Scott Helme
J
Java Code Geeks
H
Hacker News: Front Page
N
News and Events Feed by Topic
Recorded Future
Recorded Future
Martin Fowler
Martin Fowler
W
WeLiveSecurity
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
量子位
有赞技术团队
有赞技术团队

博客园 - surfsky

用阿里的 sketch 插件 FusionDesign 来快速设计中后台 用 Sketch 设计和输出响应式网页 百度、高德、腾讯、天地图、谷歌、必应瓦片图地图切图工具 MapCutter(旧名 MapTiler),支持超大图、高清切片、webgl、leaflet、maptalk、openlayers、cesium netcore 下的 Javascript 表达式求值 netcore 下的 C# 表达式求值 中标麒麟安装SQLServer 中标麒麟上开启MySql 在 MAC 下配置 Nginx Color Schema 配色随笔 .Net与 WebAssembly 随笔 关于Xamarin、Qml、数据绑定、MVC、MVVM 相关的散讲 用Nuget部署程序包 Qt3D Qt3D Shader Qt QML 2D shader LearnOpenGL FineUI 相关 EntityFramwork 七七八八 Qt qml 单例模式
Qt3D 5.9 and future
surfsky · 2017-06-08 · via 博客园 - surfsky
2017-05
http://blog.qt.io/blog/2017/05/24/qt3d/
Qt3D future
    5.9
        Use Qt Quick or QPainter to render into a texture
        Embed Qt Quick into Qt3D, including input handling
        Level of Detail support for meshes
        Text support - 2D and 3D
        Additional materials such as PBR materials
    others
        Generating and filling buffers out of QAbstractItemModels
        Billboards - camera facing entities
        Particle systems
        VR support
    new aspects:
        碰撞检测
        动画:关键帧动画;骨骼动画;Morph target animation; Removes animation workload from main thread
        物理:刚体/柔体物理模拟
        AI: 
        三维位置音效:如喇叭,越近越响
    工具
        设计时工具:场景设计器
        Qt 3D Studio
        编译时工具:资产状态监控
    More
        贴图控制
        可yizhi算法(OpenGL)
        各种3d模型的加载

2d ui嵌入到 3d里面用Scene2D
    Scene2D {
        id: qmlTexture
        output: RenderTargetOutput {
            attachmentPoint: RenderTargetOutput.Color0
            texture: Texture2D { id: offscreenTexture }
        }
        entities: [ cube ]
        Item {
            id: customQtQuickStuff
        }
    }
        

纹理加载器
    TextureLoader {
        source: "qrc:/assets/textures/pbr-default/pbr-default-metallic.png"
        minificationFilter: Texture.LinearMipMapLinear
        magnificationFilter: Texture.Linear
        wrapMode {
            x: WrapMode.ClampToEdge
            y: WrapMode.ClampToEdge
        }
        generateMipMaps: true
    }
    
新增材质
    粗糙金属材质
        MetalRoughMaterial
    粗糙金属纹理材质
        TexturedMetalRoughMaterial {
            baseColor: TextureLoader {
                format: Texture.SRGB8_Alpha8
                source: "qrc:/assets/powerup/basecolor.png"
            }
            metalness: TextureLoader { source: "qrc:/assets/powerup/metalness.png" }
            roughness: TextureLoader { source: "qrc:/assets/powerup/roughness.png" }
            normal: TextureLoader { source: "qrc:/assets/powerup/normal.png" }
            ambientOcclusion: TextureLoader { source: "qrc:/assets/powerup/ambientocclusion.png" }
        }
        
新增环境光    
    EnvironmentLight {
        id: envLight
        irradiance: TextureLoader {
            source: "qrc:/assets/envmaps/wobbly-bridge/wobbly_bridge_4k" + _envmapFormat + "_cube_irradiance.dds"

            minificationFilter: Texture.LinearMipMapLinear
            magnificationFilter: Texture.Linear
            wrapMode {
                x: WrapMode.ClampToEdge
                y: WrapMode.ClampToEdge
            }
            generateMipMaps: false
        }
        specular: TextureLoader {
            source: "qrc:/assets/envmaps/wobbly-bridge/wobbly_bridge_4k" + _envmapFormat + "_cube_specular.dds"

            minificationFilter: Texture.LinearMipMapLinear
            magnificationFilter: Texture.Linear
            wrapMode {
                x: WrapMode.ClampToEdge
                y: WrapMode.ClampToEdge
            }
            generateMipMaps: false
        }
    }
            

天空盒实体
    SkyboxEntity {
        baseName: "qrc:/assets/envmaps/wobbly-bridge/wobbly_bridge_4k" + _envmapFormat + "_cube_radiance"
        extension: ".dds"
        gammaCorrect: true
    }            
    

相机增加曝光度属性
    Camera {
        id: mainCamera
        position: Qt.vector3d(-10, 0, 0)
        viewCenter: Qt.vector3d(0, 0, 0)
        exposure: 1.4  // 曝光度
    }

加载预设的动画    
    import Qt3D.Animation 2.9
    ClipAnimator {
        id: animator
        loops: 3
        clip: AnimationClipLoader { source: "qrc:/jumpinganimation.json" }
        channelMapper: ChannelMapper {
            mappings: [
                ChannelMapping { channelName: "Location"; target: cubeTransform; property: "translation" },
                ChannelMapping { channelName: "Rotation"; target: cubeTransform; property: "rotation" },
                ChannelMapping { channelName: "Scale"; target: cubeTransform; property: "scale3D" }
            ]
        }
    }
对象选择器
    ObjectPicker { onClicked: animator.running = true;}


根据远近来动态调整场景(volumeOverride)
    LevelOfDetail
        Entity {
            components: [
                CylinderMesh {
                    radius: 1
                    length: 3
                    rings: 2
                    slices: sliceValues[lod.currentIndex]
                    property var sliceValues: [20, 10, 6, 4]
                },
                Transform {
                    rotation: fromAxisAndAngle(Qt.vector3d(1, 0, 0), 45)
                },
                PhongMaterial {
                    diffuse: "lightgreen"
                },
                LevelOfDetail {
                    id: lod
                    camera: camera
                    thresholds: [1000, 600, 300, 180]
                    thresholdType: LevelOfDetail.ProjectedScreenPixelSizeThreshold
                    volumeOverride: lod.createBoundingSphere(Qt.vector3d(0, 0, 0), 2.0)
                }
            ]
        }
    LevelOfDetailSwitch
        Entity {
            components: [
                LevelOfDetailSwitch {
                    camera: camera
                    thresholds: [20, 35, 50]
                    thresholdType: LevelOfDetail.DistanceToCameraThreshold
                }
            ]
            HighDetailEntity { enabled: false }
            MediumDetailEntity { enabled: false }
            LowDetailEntity { enabled: false }
        }
    LevelOfDetailLoader
        LevelOfDetailLoader {
            id: lodLoader
            camera: camera
            thresholds: [20, 35, 50]
            thresholdType: LevelOfDetail.DistanceToCameraThreshold
            volumeOverride: lodLoader.createBoundingSphere(Qt.vector3d(0, 0, 0), -1)
            sources: ["qrc:/HighDetailEntity.qml", "qrc:/MediumDetailEntity.qml", "qrc:/LowDetailEntity.qml"]
        }
    

渲染文本
    Text2DEntity
        Text2DEntity {
            id: text
            text: "Hello World"
            width: 20
            height: 10
        }
    ExtrudedTextMesh
        auto *text = new Qt3DCore::QEntity(root);
        auto *textTransform = new Qt3DCore::QTransform();
        auto *textMesh = new Qt3DExtras::QExtrudedTextMesh();
        textMesh->setDepth(.45f);
        QFont font(family, 32, -1, false);
        textMesh->setFont(font);
        textMesh->setText(QString(family));
        auto *textMaterial = new Qt3DExtras::QPhongMaterial(root);
        textMaterial->setDiffuse(QColor(111, 150, 255));
        text->addComponent(textTransform);
        text->addComponent(textMesh);
        text->addComponent(textMaterial);