NativeEngine render target texture not working with MSAA

so it turns out the use of DefaultRenderingPipeline is in-fact causing the issues. we’re using DefaultRenderingPipeline for all our PP needs currently. We could refactor this to using scene.imageProcessingConfiguration instead as @bghgary mentioned above but in some scenes we actually want the postprocess to also affect the background. So Im still curious whats happening here and potential remedies. guessing DefaultRenderingPipeline is creating a new renderTargetTexture and overriding the one we’re passing in?

ps: we’re constructing the pipeline as such
var pipeline = new DefaultRenderingPipeline(“defaultRPPostProcess”, true, scene, [scene.activeCamera]);

A repro would be awesome for when @bghgary will be back from his break.

1 Like

to repro just cut and paste this:
var pipeline = new BABYLON.DefaultRenderingPipeline(“defaultRPPostProcess”, true, scene, [scene.activeCamera]);

here:

you can also comment out line 64/65 if you wish.

build and run consoleapp.exe

note the lack of MSAA.

fyi we also noticed glowLayer isnt working in native either. we will need support for this to make some glowey bits for a popular microsoft product. :slight_smile: once thats working, i think we can reasonably move to using scene.imageProcessingConfiguration instead of the defaultRenderingPipeline.

You also need to set pipeline.samples = 4; , just to be sure ???

oh yes , your correct. i tried it with pipeline.samples = 4 . msaa still fails.

update: we switched over to using scene.imageProcessingConfiguration and for the most part this seems to be behaving better with Native and MSAA in general.

One issue is It seems Hardware Scaling does not work when using scene.imageProcessingConfiguration.
to repro you can just paste engine.setHardwareScaling(0.5) at line 66 in the example above. We need HW scaling to supersample the image which really helps bring out finer details.

@bghgary I think long term we will need DOF working. More important that that, we are using HDRCubeTexture and Native does not support that currently. We are using .envs in some places but .hdrs gives us more detail in reflections. So that is a more immediate need for that.

I’m back. :slight_smile:

It sounds like there are multiple asks. Can you help me prioritize which to look at first? What’s the most important?

1 Like

in general we would like to move to using scene.imageProcessingConfiguration so looking for 1:1 visual and feature parity between the two. still… i think it would be good to have msaa working with DefaultRenderingPipeline regardless just to have that flexibility if we did need to use defaultRenderingPipeline. honestly its a little confusing as to the pros/cons of using defaultRenderingPipeline.

anyway, in order of priority…

  1. add support for .hdr images
  2. fix msaa when using defaultRenderingPipeline
  3. glow layer does not seem to respect hdr values (either that or for some reason scene.imageProcessingConfiguration is not working with hdr). we were using hdr mode when using DefaultRenderingPipeline. i will try to make a repro of this in both the PG and the native examples app.
  4. support for DOF in Native
1 Like

@bghgary apologies slight typo above. note #1 is .hdr image support . sorry :slight_smile:

Can you explain this in more detail? I don’t understand why HDR would give more detail in reflections. cc @sebavan

@bghgary we tried a .env version of our .hdr and the .env version was blurrier. ( material for both tests are identcal, same roughness params…etc.) i will post a PG repro shortly

1 Like

I’m waiting for a repro for 1, so in the meantime, I will look at 2 which I am able to repro. 1 is probably for @sebavan anyways.

1 Like

blurrier might be expected as hdr if you are not prefiltering them or relying on real time filtering will be inaccurate. It might also be a resolution issue.

With @sebavan’s help, I have figured out how to get MSAA working correctly with rendering pipelines. There were two issues. I’ll put up PRs for them soon.

I have DOF working locally. I will submit a PR soon.

@Anupam_Das I’m unable to do anything else since I need repros. Let me know when they are available.

@bghgary @sebavan thank you both so much! we are pushing Native to the limits for sure but i think its going to be awesome for it. The performance improvements alone has been worth it! looking forward to your PR

2 Likes

MSAA and DOF should be working now. Please use Babylon.js npm packages 6.21.1 or higher.

For reference:

MSAA PRs

DOF PRs

@Anupam_Das Let us know when there are repros for the other two issues.

2 Likes