Skip to content

Commit

Permalink
fix(ies): light ies has bug (#109)
Browse files Browse the repository at this point in the history
fix ies index not write
  • Loading branch information
ZenderJK committed May 7, 2023
1 parent 5e6fcdb commit efc5f4d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/components/lights/LightBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class LightBase extends ComponentBase implements ILight {

protected _castGI: boolean = false;
protected _castShadow: boolean = false;
private _iesPofiles: IESProfiles;
private _iesProfiles: IESProfiles;

constructor() {
super();
Expand Down Expand Up @@ -106,15 +106,15 @@ export class LightBase extends ComponentBase implements ILight {
EntityCollect.instance.removeLight(this.transform.scene3D, this);
}

public set iesPofile(iesPofiles: IESProfiles) {
this._iesPofiles = iesPofiles;
this.lightData.iesPofiles = iesPofiles.index;
public set iesProfiles(iesProfiles: IESProfiles) {
this._iesProfiles = iesProfiles;
this.lightData.iesIndex = iesProfiles.index;
IESProfiles.use = true;
this.onChange();
}

public get iesPofile(): IESProfiles {
return this._iesPofiles;
public get iesProfile(): IESProfiles {
return this._iesProfiles;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/components/lights/LightData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,5 @@ export class LightData extends Struct {
/**
* Whether to use lighting ies
*/
public iesPofiles: number = -1;
public iesIndex: number = -1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ export class LightEntries {
memory.writeInt32(light.castShadowIndex);

memory.writeVector3(light.lightTangent);
memory.writeFloat(-1);
memory.writeFloat(light.iesIndex);
}
}

0 comments on commit efc5f4d

Please sign in to comment.