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

Add support for more depth stencil formats. #12675

Merged

Conversation

kircher1
Copy link
Contributor

This requires some rework of the logic in ThinEngine._createDepthStencilTexture, but it should be non-breaking. A similar change was made to extend MultiRenderTarget's depth-stencil texture handling too.

I've also added visualization tests to exercise the createDepthStencilTexture code path.

@kircher1
Copy link
Contributor Author

kircher1 commented Jun 22, 2022

I've been struggling to get the visualization tests working and passing locally (not just the new tests, but also existing tests). And not just for this branch, master too. So, still trying to figure that out.

@azure-pipelines
Copy link

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@azure-pipelines
Copy link

@azure-pipelines
Copy link

Visualization tests for webgl1 have failed. If some tests failed because the snapshots do not match, the report can be found at

https://babylonsnapshots.z22.web.core.windows.net/refs/pull/12675/merge/testResults/webgl1/index.html

If tests were successful afterwards, this report might not be available anymore.

@kircher1
Copy link
Contributor Author

Need to fix some GL1 related issues.

Copy link
Contributor

@Popov72 Popov72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!

You will also have to update WebGPU. It's in Engines/WebGPU/Extensions/engine.renderTarget.ts, the _createDepthStencilTexture function.

kircher1 added 3 commits June 23, 2022 10:35
… users/briank/more-depth-stencil-format-support
… users/briank/more-depth-stencil-format-support
@kircher1
Copy link
Contributor Author

You will also have to update WebGPU. It's in Engines/WebGPU/Extensions/engine.renderTarget.ts, the _createDepthStencilTexture function.

@Popov72, from the looks of it, the WebGPU implementation already handles the various depth stencil formats. Correct me if I'm wrong and I will make the necessary updates.

@azure-pipelines
Copy link

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@azure-pipelines
Copy link

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@azure-pipelines
Copy link

@Popov72
Copy link
Contributor

Popov72 commented Jun 24, 2022

I think line 83 of the file I pointed above should be replaced by:

depthTextureFormat: options.depthTextureFormat ?? options.generateStencil ? Constants.TEXTUREFORMAT_DEPTH24_STENCIL8 : Constants.TEXTUREFORMAT_DEPTH32_FLOAT,

Copy link
Member

@sebavan sebavan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as soon as @Popov72 concerns have been addressed

@kircher1
Copy link
Contributor Author

TEXTUREFORMAT_DEPTH24_STENCIL8 

@Popov72, does the spread operator for ...options on line 84 handle overwriting depthTextureFormat?

 const internalOptions = {
        bilinearFiltering: false,
        comparisonFunction: 0,
        generateStencil: false,
        samples: 1,
        depthTextureFormat: options.generateStencil ? Constants.TEXTUREFORMAT_DEPTH24_STENCIL8 : Constants.TEXTUREFORMAT_DEPTH32_FLOAT,
        ...options,
    };
`

@Popov72
Copy link
Contributor

Popov72 commented Jun 25, 2022

Yes, my bad, everything is ok with no change!

@RaananW
Copy link
Member

RaananW commented Jun 27, 2022

This is good to merge, right?

@Popov72
Copy link
Contributor

Popov72 commented Jun 27, 2022

Ok for me.

@RaananW RaananW merged commit 08dec3c into BabylonJS:master Jun 28, 2022
@kircher1 kircher1 deleted the users/briank/more-depth-stencil-format-support branch August 26, 2022 17:42
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

Successfully merging this pull request may close these issues.

4 participants