Qt3D Renderer Elements: Difference between revisions
AutoSpider (talk | contribs) (Add "cleanup" tag) |
Henri Vikki (talk | contribs) (format) |
||
Line 1: | Line 1: | ||
[[Category:Developing_with_Qt::Qt3D:Qt3D_wip_newapi_Overview ]] | [[Category:Developing_with_Qt::Qt3D:Qt3D_wip_newapi_Overview ]] | ||
= Qt3D Scene Structure and Elements = | = Qt3D Scene Structure and Elements = | ||
Line 12: | Line 12: | ||
=== Nodes === | === Nodes === | ||
* '''Effect''' | |||
Specifies a list of techniques and default values to be used by the renderer to properly assign shaders and uniforms. ===== | Specifies a list of techniques and default values to be used by the renderer to properly assign shaders and uniforms. ===== | ||
* '''RenderPass''' | |||
Specifies the ShaderProgram o be used for a pass of a technique. | Specifies the ShaderProgram o be used for a pass of a technique. | ||
The render pass should have a name. | The render pass should have a name. | ||
* '''Technique''' | |||
Contains a list of RenderPass elements. | Contains a list of RenderPass elements. | ||
* '''ShaderProgram''' | |||
Has paths pointing to fragment and vertex shader sources. | Has paths pointing to fragment and vertex shader sources. | ||
http://i58.tinypic.com/35n0osi.png | |||
==== FrameGraphItems ==== | ==== FrameGraphItems ==== | ||
Line 31: | Line 31: | ||
Only a single framegraph can be used at any moment for the rendering of the scene. | Only a single framegraph can be used at any moment for the rendering of the scene. | ||
* '''Viewport''' | |||
Defines the viewport rectangle to be used.'''Note :''' The viewport rectangle is defined from top left unlike OpenGL which defines it from bottom left. ===== | Defines the viewport rectangle to be used.'''Note :''' The viewport rectangle is defined from top left unlike OpenGL which defines it from bottom left. ===== | ||
* '''CameraSelector''' | |||
Defines the camera entity to be used. | Defines the camera entity to be used. | ||
* '''RenderPassFilter''' | |||
Defines the name of the RenderPass to be used. | Defines the name of the RenderPass to be used. | ||
* '''RenderTargetSelector''' | |||
To be done - Defines the RenderTarget (Texture/FBO/Screen) | To be done - Defines the RenderTarget (Texture/FBO/Screen) | ||
* '''TechniqueFilter''' | |||
Defines the name of the technique to be used. | Defines the name of the technique to be used. | ||
http://i59.tinypic.com/2885yit.png | |||
=== Entity === | === Entity === | ||
* '''Scene''' | |||
Has a source property that can be set to the path of a 3D scene file to be loaded into the current scenegraph tree. | |||
=== Components === | === Components === | ||
* '''Mesh''' | |||
Specifies the path toward a mesh source file. | Specifies the path toward a mesh source file. | ||
* '''Material''' | |||
Specifies an Effect and may override uniforms set by the Effect to be used | Specifies an Effect and may override uniforms set by the Effect to be used | ||
by the Techniques' ShaderPrograms | by the Techniques' ShaderPrograms | ||
Also specifies the textures. | Also specifies the textures. | ||
* '''Shape''' | |||
Can be a shaper of one of the types : | Can be a shaper of one of the types : | ||
'''''' Cube | '''''' Cube | ||
Line 98: | Line 98: | ||
}</code> | }</code> | ||
* '''FrameGraph''' | |||
Defines the tree of FrameGraphItems to be used as the rendering pipeline. ==== | Defines the tree of FrameGraphItems to be used as the rendering pipeline. ==== | ||
Line 138: | Line 138: | ||
} | } | ||
} | } | ||
</code> |
Revision as of 08:23, 30 March 2015
Qt3D Scene Structure and Elements
Renderer elements
The Renderer aspect defines its own set of elements.
Nodes
- Effect
Specifies a list of techniques and default values to be used by the renderer to properly assign shaders and uniforms. =====
- RenderPass
Specifies the ShaderProgram o be used for a pass of a technique. The render pass should have a name.
- Technique
Contains a list of RenderPass elements.
- ShaderProgram
Has paths pointing to fragment and vertex shader sources.
FrameGraphItems
Only a single framegraph can be used at any moment for the rendering of the scene.
- Viewport
Defines the viewport rectangle to be used.Note : The viewport rectangle is defined from top left unlike OpenGL which defines it from bottom left. =====
- CameraSelector
Defines the camera entity to be used.
- RenderPassFilter
Defines the name of the RenderPass to be used.
- RenderTargetSelector
To be done - Defines the RenderTarget (Texture/FBO/Screen)
- TechniqueFilter
Defines the name of the technique to be used.
Entity
- Scene
Has a source property that can be set to the path of a 3D scene file to be loaded into the current scenegraph tree.
Components
- Mesh
Specifies the path toward a mesh source file.
- Material
Specifies an Effect and may override uniforms set by the Effect to be used by the Techniques' ShaderPrograms Also specifies the textures.
- Shape
Can be a shaper of one of the types : ' Cube ' Sphere ' Cylinder ' Torus Additional properties allow to further define the shape and its precision. =====
Mesh {
id: ballMesh
objectName: "ballMesh"
source: ":/assets/ball.obj"
}
Material {
id: ballMaterial
objectName: "ballMaterial"
// effect: adsEffect
// Custom properties go here
}
Entity {
id: ball
objectName: "ball"
property Transform transform: Transform {
Translate{ dx: 0; dy: –10; dz : 25 }
Scale {scale : 0.1}
}
property Mesh mesh: ballMesh
property Material material: ballMaterial
}
- FrameGraph
Defines the tree of FrameGraphItems to be used as the rendering pipeline. ====
import Qt3D 2.0
import Qt3D.Render 2.0
TechniqueFilter {
property alias viewportRect: viewport.rect
property alias cameraViewportTopRight: cameraSelectorTopRight.camera
property alias cameraViewportBottomLeft: cameraSelectorBottomLeft.camera
tags: [
Tag { name: "style"; value: "forward"}
]
Viewport {
id: viewport
objectName : "viewport"
rect: Qt.rect(0.0, 0.0, 1.0, 1.0) // From Top Left
Viewport {
id : top_right_viewport
rect: Qt.rect(0.5, 0, 0.5, 0.5)
CameraSelector {
RenderPassFilter { renderPassName: "zFill" }
RenderPassFilter { renderPassName: "lighting" }
}
}
Viewport {
id : bottom_left_viewport
rect: Qt.rect(0.0, 0.5, 0.5, 0.5)
CameraSelector {
RenderPassFilter { renderPassName: "zFill" }
RenderPassFilter { renderPassName: "lighting" }
}
}
}
}