GLScene icon indicating copy to clipboard operation
GLScene copied to clipboard

Advanced Demo "Earth" range check errors with software rendering.

Open SkybuckFlying opened this issue 1 year ago • 1 comments

The advanced demo "earth" in the folder "..\GLScene\AdvDemos\Earth" produces range check errors with software rendering.

To turn software rendering on use the object inspector and navigate to the following property:

GLSceneViewer.Buffer.ContextOptions.roSoftwareMode checkbox True.

It would be great if these range check errors and integer overflow errors could be solved so that software rendering mode works too.

SkybuckFlying avatar Aug 03 '22 12:08 SkybuckFlying

In folder: ..\GLScene\AdvDemos\Earth

4.1 Fixing the Advanced Earth Demo for software rendering:

4.1.1. Change GLSceneViewer.Buffer.ContextOptions.roSoftwareMode to true.

4.1.2. Change GLSceneViewer.Buffer.AccumBufferBits from 0 to 8, 16, 24 or 32.

4.1.3. Deleting the flare component from the sun component:

GLScene(right click)->Show Scene Editor->LSSun->GLLensFlare1

Right click->delete object

4.1.4. Disable following two lines in GLScene library unit: GLS.Graphics.pas

    for slice := 0 to d - 1 do
    begin
    	// Skybuck: disabled, buggy in software mode
//      Build2DMipmap(GetLevelAddress(0), LAddresses, fColorFormat, fDataType,
//        AFilter, GetWidth, GetHeight);
      for level := 1 to fLevelCount - 1 do
        Inc(PByte(LAddresses[level - 1]), GetLevelSizeInByte(level) div d);
    end;

4.1.5. Disable the following line in fEarthd.pas:

procedure TForm1.GLSceneViewerBeforeRender(Sender: TObject);
begin
//  GLLensFlare1.PreRender(Sender as TGLSceneBuffer);

SkybuckFlying avatar Aug 06 '22 13:08 SkybuckFlying