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

PBR improvements #3225

Closed
11 of 14 tasks
AMajesticSeaFlapFlap opened this issue Feb 7, 2022 · 14 comments
Closed
11 of 14 tasks

PBR improvements #3225

AMajesticSeaFlapFlap opened this issue Feb 7, 2022 · 14 comments
Assignees

Comments

@AMajesticSeaFlapFlap
Copy link
Contributor

AMajesticSeaFlapFlap commented Feb 7, 2022

to track future improvements/fixes for the PBR material/IBL OP

  • fix tangent space generation for cables/display a warning that meshes with normal maps will require exported tangents
  • automatically enable use mesh tangents/binormals if a normal map is connected
  • implement microsurface interreflections using the filament approach
  • add tonemapping
  • add lightmap support with rgbe/exr
  • add more shader features such as clearcoat/...
  • add support for point/spot/directional lights
  • add option to also apply geometric roughness on the normal map? :/
  • add environment rotation as a parameter to IBL precomputation
  • add option for using vertex colours as base colour/AORM/AO/R/M
  • fix problem with environment light when opening a patch in a new tab and only tabbing in after a second. this will cause the generated maps to be black.
  • generate the BRDF LUT only once per patch and not once per OP
  • add even cooler shader features such as SSS/cloth/...
  • better sampling algorithm for environment light OP
@tastez
Copy link

tastez commented Feb 8, 2022

environment rotation?

@steam0r steam0r removed the new label Feb 10, 2022
@AMajesticSeaFlapFlap
Copy link
Contributor Author

AMajesticSeaFlapFlap commented Feb 21, 2022

microsurface interreflections seem to work https://dev.cables.gl/p/QbcBoY but there is still some energy lost somewhere with a furnace test https://dev.cables.gl/p/NF0arY maybe also related to IBL precomputations? swapped out large parts of the shaders and seems to be fine now

@AMajesticSeaFlapFlap
Copy link
Contributor Author

added the tonemapping operators from https://github.com/BabylonJS/Babylon.js/blob/5e6321d887637877d8b28b417410abbbeb651c6e/src/Shaders/tonemap.fragment.fx
image

@AMajesticSeaFlapFlap
Copy link
Contributor Author

made tangent space from mesh default option, removed Gram-Schmidt. I think exposing this option did only help in a tiny amount of cases and leads to more confusion than what its worth.

@AMajesticSeaFlapFlap
Copy link
Contributor Author

AMajesticSeaFlapFlap commented Mar 21, 2022

added code for spot/directional/point lights. radius doesnt work properly on specular part yet it seems.

@AMajesticSeaFlapFlap
Copy link
Contributor Author

added rotation parameter to IBL precompute @tastez . exposed as values from 0-1, not sure if 0-360 would be more intuitive.

@AMajesticSeaFlapFlap
Copy link
Contributor Author

added vertex colour support:
image

@tastez
Copy link

tastez commented Mar 28, 2022

think i found the reason for the black screen when trying to use lights to generate shadows (from my old example)
Lights have to be placed Below the pbrenvironment/precomputeIBL op, otherwise it will render a black map.

checked the patch where i had the issue and indeed the light is above pbr environment
image

Connecting it in the editor sometimes will look like it works and then when you reload it doesn't - this might happen if you connected it "correctly" once and then decided to move a light op above the environment texture.

btw - should i switch to using PrecompuleIBL V2 on dev with the updated PBR material?
also - will it be renamed to PBRenvironment later?

@pandrr
Copy link
Member

pandrr commented Mar 28, 2022

  • will it be renamed to PBRenvironment later?
    we could, but isnt it like an ambient light in some form ?

@AMajesticSeaFlapFlap
Copy link
Contributor Author

yes for testing on dev use precompute IBL v2 until the updated OP is pushed

@pandrr
Copy link
Member

pandrr commented Mar 28, 2022

it is pushed to dev now, compiled changelog here: #990 (comment)

@tastez
Copy link

tastez commented Mar 29, 2022

since PBRmaterial can now be used with just cables lights - would be nice to add exceptions to these warnings..but i guess it is on the lights' end?
image

@tastez
Copy link

tastez commented Mar 31, 2022

Shadows and Rotate in PBR Environment can produce issues -

pbr_rotate_shadow.mp4

PBR Environment texture size sometimes doesnt update until you rotate texture

pbr_rotate_size.mp4

invited @AMajesticSeaFlapFlap to this test patch https://dev.cables.gl/edit/5IYNw-

@AMajesticSeaFlapFlap
Copy link
Contributor Author

lightmap support and clear coat added in #3555

@steam0r steam0r added the pbr label May 19, 2023
@steam0r steam0r closed this as completed Sep 18, 2023
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

4 participants