Skip to content

Commit

Permalink
Add missing setParameter variants to MaterialInstance (#6973)
Browse files Browse the repository at this point in the history
Adds support for mat3/mat4 parameter types
  • Loading branch information
romainguy committed Jul 20, 2023
1 parent 0b60933 commit 176915b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NEW_RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ for next branch cut* header.
appropriate header in [RELEASE_NOTES.md](./RELEASE_NOTES.md).

## Release notes for next branch cut

- web: Added missing setMat3Parameter()/setMat4Parameter() to MaterialInstance
2 changes: 2 additions & 0 deletions web/filament-js/filament.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ export class MaterialInstance {
public setFloat2Parameter(name: string, value: float2): void;
public setFloat3Parameter(name: string, value: float3): void;
public setFloat4Parameter(name: string, value: float4): void;
public setMat3Parameter(name: string, value: mat4): void;
public setMat4Parameter(name: string, value: mat3): void;
public setTextureParameter(name: string, value: Texture, sampler: TextureSampler): void;
public setColor3Parameter(name: string, ctype: RgbType, value: float3): void;
public setColor4Parameter(name: string, ctype: RgbaType, value: float4): void;
Expand Down
6 changes: 6 additions & 0 deletions web/filament-js/jsbindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1290,6 +1290,12 @@ class_<MaterialInstance>("MaterialInstance")
.function("setFloat4Parameter", EMBIND_LAMBDA(void,
(MaterialInstance* self, std::string name, filament::math::float4 value), {
self->setParameter(name.c_str(), value); }), allow_raw_pointers())
.function("setMat3Parameter", EMBIND_LAMBDA(void,
(MaterialInstance* self, std::string name, filament::math::mat3f value), {
self->setParameter(name.c_str(), value); }), allow_raw_pointers())
.function("setMat4Parameter", EMBIND_LAMBDA(void,
(MaterialInstance* self, std::string name, filament::math::mat4f value), {
self->setParameter(name.c_str(), value); }), allow_raw_pointers())
.function("setTextureParameter", EMBIND_LAMBDA(void,
(MaterialInstance* self, std::string name, Texture* value, TextureSampler sampler), {
self->setParameter(name.c_str(), value, sampler); }), allow_raw_pointers())
Expand Down

0 comments on commit 176915b

Please sign in to comment.