[Solved new in 4.2] FresnelParameters ctor

I’m adding FresnelParameters to a declarative Babylonjs library. Anyway, FresnelParameters has no constructor, I was wondering if a PR would be accepted that added one. If so, is the preferred method to have an options object? Thanks (I can make PR).

FresnelParameters should have a default empty constructor, what would bring the addition of a new one ?

Yes, you are right about the default constructor. I meant there exists no constructor that sets values. I am fine if you don’t want to add one to keep library size down or any other reason. Right now I can declare on textures like this:

<standardMaterial diffuseColor={Color3.Green()}>
        <texture assignTo="bumpTexture" url={'http://i.imgur.com/wGyk6os.png'} />
      </standardMaterial>

I would like to be able to assign FresnelParameters like colours as BabylonJS objects via new. Ie: ‘new FresnelParameters({power: 4})’ without using the static creation method Parse ideally as that feels a bit unintuitive.

I can get around this by creating a host element for “FresnelParameters” and use assignTo functionality (like texture does in snippet above). So, the material property to assign can be set as opacity/reflective/etc and likely want to do that anyway, but feel that it would be nicer to offer both types of declarative assignment. So, partly laziness and partly wanting to provide a better experience.

Feel free to close out if you feel this is unnecessary:)

Not at all just trying to understand and it makes sense, feel free to make a PR if you want :slight_smile:

1 Like