How to use StencilTest and StencilOperation QML?



  • I want to use stencil buffer, but in QML it says back and front properties are readonly and StencilTestArguments & StencilOperationArguments cannot instantiate on their own.

    So how can I use it ?

                            StencilTest {
                                back: StencilTestArguments {
                                    faceMode: StencilTestArguments.Back
                                    stencilFunction: StencilTestArguments.Always
                                    referenceValue: 0
                                    comparisonMask: 0
                                }
                                front: StencilTestArguments {
                                    faceMode: StencilTestArguments.Front
                                    stencilFunction: StencilTestArguments.Always
                                    referenceValue: 0
                                    comparisonMask: 0
                                }
                            }
    


  • I understand it:

    StencilTest {
                                back.stencilFunction:StencilTestArguments.Always
                                back.referenceValue: 0
                                back.comparisonMask: 0
                                front.stencilFunction: StencilTestArguments.Always
                                front.referenceValue: 0
                                front.comparisonMask: 0
                            },
                            StencilOperation {
                                back.allTestsPassOperation: StencilOperationArguments.Increment
                                back.stencilTestFailureOperation: StencilOperationArguments.Keep
                                back.depthTestFailureOperation: StencilOperationArguments.Keep
                                front.allTestsPassOperation: StencilOperationArguments.Increment
                                front.stencilTestFailureOperation: StencilOperationArguments.Keep
                                front.depthTestFailureOperation: StencilOperationArguments.Keep
                            }
    

    and the faceMode property is readonly.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.