QC 125635
QC 125635
Found a bug in XE4, can someone see if this is still in XE6?
When you use several lights in your FMX 3D application (3 or more)
you probably want to enable and disable lights at runtime.
Doing this you run into the problem: some of the enabled lights will be ignored, depending on the order you added the lights to the application.
The bug is in the FMX.Materials unit. I fixed it there, no workaround.
Found a bug in XE4, can someone see if this is still in XE6?
When you use several lights in your FMX 3D application (3 or more)
you probably want to enable and disable lights at runtime.
Doing this you run into the problem: some of the enabled lights will be ignored, depending on the order you added the lights to the application.
The bug is in the FMX.Materials unit. I fixed it there, no workaround.
http://qc.embarcadero.com/wc/qcmain.aspx?d=125635
ReplyDeleteIt would appear to have been fixed: in XE6, the procedure TLightMaterial.DoApply starts with the following lines:
ReplyDelete// lights
CLight := 0;
for i := 0 to Context.Lights.Count - 1 do
if Context.Lights[i].Enabled then
Inc(CLight);
CLight := Min(TContext3D.MaxLightCount, CLight);
the start is similar in XE4,
ReplyDeletebut the bug is further down in the method, this line:
for i := 0 to Min(MaxLightCount, Context.Lights.Count) - 1 do
Ah. I see what you mean. Then no, it hasn't been fixed. That code is still as follows:
ReplyDelete// lights
if MaxLightCount > 0 then
begin
CLight := 0;
for i := 0 to Min(MaxLightCount, Context.Lights.Count) - 1 do
if Context.Lights[i].Enabled then
begin
LLight := Context.Lights[i];
BTW, perhaps you should add a line with
ReplyDelete// ...
to your code snippet to indicate that you've omitted lines of code. Or specify the line number where the error occurs; that would make it easier to spot which line you're talking about.
Good point, but it is in the project attached to the QC entry. ;)
ReplyDeleteThanks to Tomohiro Takahashi,
ReplyDeletewho took the time to test it out in XE6,
the report is now open.
(same day)