PBR Window/bottle PBR material issue?

Hello, i have a question regarding alpha half-transparency using PBR materials.

Usually were using just AlphaThreshold and Transparency bucket.
But now need make half-transparent materials.

Im not sure if i do something wrong, or if this is PBR bug. but here is detail:


basic Opaque bucket:

geom.setQueueBucket(RenderQueue.Bucket.Opaque);

image


The transparent bucket cause roughness to be 0 value. Is this bug? the light prove envmap is not affected by roughness. see below:

geom.setQueueBucket(RenderQueue.Bucket.Transparent);
geom.getMaterial().getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);


for some reason Translucent bucket(the wrong one for this, since it render over everything) render it properly, but as i remember Translucent is just for render after everything, even postprocessings - so maybe post processings cause issue for Transparent bucket? just to show it’s result:

geom.setQueueBucket(RenderQueue.Bucket.Translucent);        
geom.getMaterial().getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);

image

if this is a BUG, can create github issue for this.
But if this is some my failure, please help.

IMO the middle configuration should work, but it cause roughness be 0.

Does it happen even if there is no post-processing filter added?

1 Like

thanks to you i tried it again and i noticed:

  • PBR correctly use envmap - thats not the issue
  • transparency dont take Clouds postprocessing in mind, it only take default skybox(for lightprobe generation purpose).

    VClouds cloudProcessor= new VClouds(assetManager, cam);
    getViewPort().addProcessor(cloudProcessor);
    cloudProcessor.setLightDir(lightDir);
    cloudProcessor.seCloudCoverage(1); 

so now it lead me to other questions. I am using @dreamwagon VClouds that looks awesome, but for some reason PBR light probe generator dont render it into envmap, also this transparency here dont see it trully.

Note: i need to have his(VClouds) processor before other filter processor, otherwise it replace all view.

i belive @RiccardoBlb new pipeline might solve this problem too (maybe), but not sure if it affects transparency bucket rendering.

Questions:

  • how solve to make transparency see his processor? (this topic issue)

  • is this possible so PBR light probe generation could generate using his processor clouds/sky? (its maybe more related for @dreamwagon if he know)

because if i will just remove main skybox(after probe is generated from it), the only issue left, is that it just dont see VClouds processor result in transparent area like below:

image

I would suggest to try to pinpoint one problem at a time using very simple test cases. Now I have an overload of different inputs and possible causes/solutions.

  • create an application that only renders the sky and generate a light probe from it. use the DebugLightsState to visualize the lightprobe to see if it was correctly generated or not.
  • create an application that only renders the bottle and some quad behind it (to test the transparency) and see if you can recreate the problem.
2 Likes

i always try provide as many information as i can.

But here is short:

  • using ONLY default JME skybox it work fine
  • using VClouds from this post: Geometry and Compute Shaders - #81 by dreamwagon
    transparency do not see it as background from alpha areas. (and his skybox is “implements SceneProcessor” class)
  • using second point, but Translucent bucket, it see VClouds properly. but Translucent bucket is wrong for transparency like this.

this apps i test with, are trully just using default configurations i use, nothing special there except filters/clouds.
If will be unable to solve it, i think it would be better anyway wait for Riccardo pipeline, because it will require rebuild filters a lot anyway. Maybe then, if there will be still issues, will just prepare special TestCases to download.

2 Likes

I’m also using VClouds, and I’m also having issues baking it to an environment map. I haven’t tested with transparent geometry, but I don’t really see an opportunity/reason to expect a different result than you’re getting here.

1 Like

yes, we should wait for new Render pipeline, because it would be like re-do work later i think, if this require VClouds changes.

1 Like

Well, I don’t believe timing on my project will allow for that unless the pipeline release is imminent - but if that’s the case I’m happy to contribute the needed work to VClouds.

1 Like

No matter what render pipeline is implemented, custom post processing will maybe make some assumptions that don’t work in certain use cases.

So I think regardless of waiting or not, the external cloud code that isn’t working probably needs someone to look at it.

2 Likes

thanks, any idea what we would need change there to make it work? some suggestions?

since it is post-processing related issue, i thought new Ricc pipeline might solve it to save double-work(because anyway it will need be adjusted to new pipeline later).

but if you say its not worth wait, i might try at least. or wait for @dreamwagon that seems to be not online past time.

I’m saying the problems that need to be fixed are probably roughly the same either way… and there is no specific timeline for the new pipeline.

The normal skybox is rendered as part of the sky bucket… which is rendered after the opaque bucket and before the transparent bucket. The easiest way for a cloud layer to play nice is to be rendered in the sky bucket.

2 Likes

he use:

public Geometry applyQuad;
private Geometry skyGeometry;
private Geometry cloudGeometry;

well i set Sky Bucket for all of them. But it dont help.

even for:

	Geometry g = new Geometry("FSQuad", m);
            g.setQueueBucket(RenderQueue.Bucket.Sky);

Please note he do it in SceneProcessor class, so im not sure if this will help anyway.

This SceneProcessor is added before any other processor(filters). Otherwise it just replace(is over) default render.

here is this class:

I’m just telling you how the normal sky bucket works. If the geometry is rendered after the opaque bucket and before the transparent bucket then it is guaranteed to be seen properly through transparent objects and it should be seen in light probes (unless the camera setup is somehow different in a way that is incompatible with light probes).

I don’t really want to drill into code that isn’t mine and try to fix it. I was just giving hints.

If the clouds are rendered in the sky bucket as part of the regular scene then they are 100% guaranteed to work with transparency. So if you can’t see clouds through your clear bottle then the clouds were rendered after your bottle. In their own viewport or whatever.

1 Like

thanks.

i understand what you mean, that we need render this before Transparent bucket render.

and for SceneProcessor i dont see possibility set render queue for it, since its dedicated render Quad.

It would require rebuild it to use SkyBox that im newbie at.

I did an experiment with doing exactly that, but so far I’ve had no success. I don’t see anything in the VClouds source to cause issues with it, so I’m fairly certain it’s just a matter of tracking down a setup issue in my code. I’ve been busy with other things and haven’t had a chance to revisit it yet - but when I do I’ll share any positive results.

1 Like

hope you will success.

skybox is using 360 degree texture, while here it is just view quad, so im not sure how to do it. Well, maybe do some trick and make “far distance” quad matching viewport width/height and just set it in Sky Bucket. idk,

The EnvironmentCamera class does 360 degree snapshots. My approach is to add the VClouds processor to the viewports used by the EnvironmentCamera and then take environment snapshots as usual. I believe this is a reasonable approach, and I guess I’m just missing some minor detail at the moment.

1 Like