Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new three.js version be of no effect #4

Open
dytmh opened this issue May 7, 2019 · 1 comment
Open

new three.js version be of no effect #4

dytmh opened this issue May 7, 2019 · 1 comment

Comments

@dytmh
Copy link

dytmh commented May 7, 2019

new three.js version be of no effect

this.renderer.clear();

	var gl = this.renderer.context;

    if ( this.showCaps ) {

        this.renderer.state.buffers.stencil.setTest( true );

        this.renderer.state.buffers.stencil.setFunc( gl.ALWAYS, 1, 0xff );
        this.renderer.state.buffers.stencil.setOp( gl.KEEP, gl.KEEP, gl.INCR );
        this.renderer.render( this.backStencil, this.camera );

        this.renderer.state.buffers.stencil.setFunc( gl.ALWAYS, 1, 0xff );
        this.renderer.state.buffers.stencil.setOp( gl.KEEP, gl.KEEP, gl.DECR );
        this.renderer.render( this.frontStencil, this.camera );

        this.renderer.state.buffers.stencil.setFunc( gl.EQUAL, 1, 0xff );
        this.renderer.state.buffers.stencil.setOp( gl.KEEP, gl.KEEP, gl.KEEP );
        this.renderer.render( this.capsScene, this.camera );

        this.renderer.state.buffers.stencil.setTest( false );

    }

    this.renderer.render( this.scene, this.camera );
@TriggerBlazer
Copy link

i try this
`
if ( this.showCaps ) {

		this.renderer.state.buffers.stencil.setTest( true );
		this.renderer.state.buffers.stencil.setLocked( true );

		this.renderer.state.buffers.stencil.setFunc( gl.ALWAYS, 1, 0xff );
		this.renderer.state.buffers.stencil.setOp( gl.KEEP, gl.KEEP, gl.INCR );		
		this.renderer.render( this.backStencil, this.camera );

		this.renderer.state.buffers.stencil.setFunc( gl.ALWAYS, 1, 0xff );
		this.renderer.state.buffers.stencil.setOp( gl.KEEP, gl.KEEP, gl.DECR );
		this.renderer.render( this.frontStencil, this.camera );

		this.renderer.state.buffers.stencil.setFunc( gl.EQUAL, 1, 0xff );
		this.renderer.state.buffers.stencil.setOp( gl.KEEP, gl.KEEP, gl.KEEP );
		this.renderer.render( this.capsScene, this.camera );


		this.renderer.state.buffers.stencil.setLocked( false );
		this.renderer.state.buffers.stencil.setTest( false );

	}

	this.renderer.render( this.scene, this.camera );`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants