brianzinn / react-babylonjs

React for Babylon 3D engine
https://brianzinn.github.io/react-babylonjs/
812 stars 102 forks source link

<pbrMaterial> are not fully supported for all properties #259

Closed aliwangzai closed 1 year ago

aliwangzai commented 1 year ago

Hi, pbrMaterial does not support propery like "isFractionEnabled" I am new to React , I tried to modify the source code . I didn't get this to work ! :(

brianzinn commented 1 year ago

hi @aliwangzai -- Only properties from the API are supported. https://doc.babylonjs.com/typedoc/classes/BABYLON.PBRMaterial

Have you added your own properties?

aliwangzai commented 1 year ago

I see ,I just want change the property by code . some properties beyond the API but actually exists in the Inspector Editor of Material . 😃 ,maybe the property are not exposed yet ?

brianzinn commented 1 year ago

Can you show a screenshot of where you see this? I can't find it anywhere: https://github.com/BabylonJS/Babylon.js/search?q=isFractionEnabled

aliwangzai commented 1 year ago
image

above , there are also other properties not being exposed

sorry , My fault , It's "isRefractionEnabled"

brianzinn commented 1 year ago

oh yes @aliwangzai. that's the PBR Subsurface Configuration! 😄 You need assignFrom="subSurface" like this (sorry it's a not easy to see, but it's in the new upcoming docs).

<pbrMaterial >...
  <pbrSubSurfaceConfiguration assignFrom='subSurface' isRefractionEnabled={YourValueHere} />
</pbrMaterial>

There is an example here with ClearCoatConfiguration: https://brianzinn.github.io/react-babylonjs/?path=/story/textures--dynamic-config

aliwangzai commented 1 year ago

Thanks for ur help !