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

Update shaders .d.ts #16914

Merged
merged 4 commits into from Jun 27, 2019

Conversation

Projects
None yet
3 participants
@FishOrBear
Copy link
Contributor

commented Jun 26, 2019

No description provided.

@FishOrBear

This comment has been minimized.

Copy link
Contributor Author

commented Jun 26, 2019

and test code

import { FXAAShader, ShaderPass } from "three";

export class FXAAPass extends ShaderPass
{
    constructor()
    {
        super(FXAAShader);
    }

    setSize(width: number, height: number)
    {
        this.uniforms['resolution'].value.set(1 / width, 1 / height);
    }
}

@FishOrBear FishOrBear changed the title Update FXAAShader.d.ts Update shaders .d.ts Jun 26, 2019

@FishOrBear

This comment has been minimized.

Copy link
Contributor Author

commented Jun 26, 2019

import { FXAAShader } from "three/examples/jsm/shaders/FXAAShader";
export class Test
{
    test()
    {
        console.log(FXAAShader);
        FXAAShader.fragmentShader = "new shader";
    }
}
@FishOrBear

This comment has been minimized.

Copy link
Contributor Author

commented Jun 26, 2019

Update:
There is no need to modify the following content, because this object will not be added to Scene now.

FullScreenQuad does not inherit from Object3D in the source code.
But in OutlinePass, this instance was added to Scene, setting it in the type definition and inheriting from Object3D seems to have no problem.

in OutlinePass.js

        this.fsQuad = new Pass.FullScreenQuad(null);
        this.fsQuad.frustumCulled = false; // Avoid getting clipped
        this.scene.add(this.fsQuad);

Can I submit this change?

export namespace Pass
{
    class FullScreenQuad extends Object3D
    {
        constructor(material?: Material);

        render(renderer: WebGLRenderer): void;

        material: Material;
    }
}

And now have this warning
THREE.Object3D.add: object not an instance of THREE.Object3D.

@Mugen87

This comment has been minimized.

Copy link
Collaborator

commented Jun 26, 2019

Let's do this in a different PR and focus on the shaders here. The changes to RectAreaLightHelper.d.ts and SpotLightHelper.d.ts should probably also handled separately but it's okay for me if we keep them in this PR.

@FishOrBear

This comment has been minimized.

Copy link
Contributor Author

commented Jun 27, 2019

Ok first merge this pr

@mrdoob mrdoob added this to the r107 milestone Jun 27, 2019

@mrdoob mrdoob merged commit 5ca4c4f into mrdoob:dev Jun 27, 2019

2 checks passed

LGTM analysis: JavaScript No new or fixed alerts
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@mrdoob

This comment has been minimized.

Copy link
Owner

commented Jun 27, 2019

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.