Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. Qt3D: Do I need to re-enable the state ( ColorMask for example) in next RenderPass?
Forum Updated to NodeBB v4.3 + New Features

Qt3D: Do I need to re-enable the state ( ColorMask for example) in next RenderPass?

Scheduled Pinned Locked Moved Unsolved Game Development
1 Posts 1 Posters 406 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • sprhawkS Offline
    sprhawkS Offline
    sprhawk
    wrote on last edited by
    #1

    I need multiple pass rendering,
    In first pass I set the stencil buffer, the second I draw color buffer with stencil test.

    renderPasses: [
                    RenderPass {
                        shaderProgram: clipShader
                        renderStates: [
                            ClipPlane { planeIndex: 0 },
                            ColorMask {
                                alphaMasked: false
                                redMasked: false
                                blueMasked: false
                                greenMasked: false
                            },
                            CullFace {
                                mode: CullFace.NoCulling
                            },
    
                            StencilTest {
                                back.stencilFunction:StencilTestArguments.Always
                                back.referenceValue: 0
                                back.comparisonMask: 0xff
                                front.stencilFunction: StencilTestArguments.Always
                                front.referenceValue: 0
                                front.comparisonMask: 0xff
                            },
                            StencilOperation {
                                back.allTestsPassOperation: StencilOperationArguments.DecrementWrap
                                back.stencilTestFailureOperation: StencilOperationArguments.Keep
                                back.depthTestFailureOperation: StencilOperationArguments.Keep
                                front.allTestsPassOperation: StencilOperationArguments.IncrementWrap
                                front.stencilTestFailureOperation: StencilOperationArguments.Keep
                                front.depthTestFailureOperation: StencilOperationArguments.Keep
                            }
                        ]
                    },
                    RenderPass {
                        shaderProgram: clipShader
                        renderStates: [
                            ClipPlane { planeIndex: 0 },
                            // If I comment out ColorMask, nothing is drawn
                            ColorMask {},
                            CullFace {
                                mode: CullFace.Front
                            },
    
                            StencilTest {
                                back.stencilFunction:StencilTestArguments.Equal
                                back.referenceValue: 1
                                back.comparisonMask: 0xff
                                front.stencilFunction: StencilTestArguments.Equal
                                front.referenceValue: 1
                                front.comparisonMask: 0xff
                            },
                            StencilOperation {
                                back.allTestsPassOperation: StencilOperationArguments.Keep
                                back.stencilTestFailureOperation: StencilOperationArguments.Keep
                                back.depthTestFailureOperation: StencilOperationArguments.Keep
                                front.allTestsPassOperation: StencilOperationArguments.Keep
                                front.stencilTestFailureOperation: StencilOperationArguments.Keep
                                front.depthTestFailureOperation: StencilOperationArguments.Keep
                            }
    
                        ]
                    }
    

    In the second RenderPass I must specify a ColorMask, or else nothing will be drawn.

    So during the render passes, the all the RenderStates are all kept along ?

    ( Shouldn't each render pass have its own render state? )

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved