I decided to try to move from my old Delphi 6 with GlScene 1.0 setup to either Lazarus or CodeTyphon.
My project is fairly big and complex, and I still cannot get it to run flawless in neither Lazarus or CT.
Lazarus 1.6x with GLScene 1.4 looks the most promising.
But I get a SIGSEGV error, and my game loads without any textures.
Transparent objects are also showing up.
Any idea what this problem can be?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Daniel good news :) first i suggest you to use Lazarus 1.8 (actually 1.8RC5) rather tha CodeTyphon. Because codeTyphon ten to take an another way (no same file extension for example) and i'm only maintain GLScene For Lazarus. The actual SVN GLsCene LCL is partially synchronized with the actual Trunk (so it's GLScene version 1.5) Take care with image in some case they're not work properly due to the incompatibily with Delphi's TBitmap (i'm working on) some packages are not ready to use like ODE, Newtown, Cuda/OpenCL, Bass and FMod.
In my next update for cross compiling issues, the ODE, Newton, Bass, and surely deprecated FMod will be remove. I can list all the changes i do yet, it's huge but for example you'll can play OGG (only with 32bit scompiler) /Mp3 sound with OpenAL.
I'll make next update when Lazarus 1.8 Stable will out and i'll add GLScene to the OnlinePackage manager tool for esay an install.
Before try to move tour project just try convert some little part one by one and make some little sample to see if all work. It will be better for debuging and will can help me if you find bugs.
A Clue for textue take care the ImageClassName property is not "Blank Image" or "Pic File" set it to "Persistent Image"
And i'm just updating GLScene for Lazarus slowly because i've not many time to code and the second reason i'm working on a big project (a fork of GLScene for using OpenGL Core and Vulkan) so........
If you need some help with Lazarus post on the dedicated sub forum. Thanks
Cheers
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Jerome!
Yes, I'm very happy with the migration to Lazarus! Thank you for the recommendation!
I'm sorting out alot of little problems, some seems to be related to the change from Delphi to Lazarus.
And some problems seems to be the change from GlScene 1.0 to 1.5.
One thing I cannot understand is why the PFX Source FX randomization changed. In Delphi/GLScene1.0 my PFXSource had a position/velocity dispersion which worked. After the upgrade to Lazarus it does not work, same values. It seems to just mix between the extreme values. See screenshots:
If a make a simple test program with the Perlin, everything works fine!
So something in my main game is messing with the sourcePFX, in 1.5, which was not a problem in 1.0...
No idea what!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm checking the GLParticleFX.pas unit and i discover some incompatible things
1st : just try change near line 1680 change
procedure DistToRegionIdx; register;{$IFOPTO-} begin regionIdx := Trunc((dist - distDelta) * invRegionSize);{$ELSE} // !! WARNING !! This may cause incorrect behaviour if optimization is turned // off for the project. asm FLD dist FSUB distDelta FMUL invRegionSize FISTP regionIdx{$ENDIF} end;
All the demos and samples works fine.
But something in my code or an object messes with the sourcePFXEffect dispersions.
When I use my main exterior camera in the same GLScene as the fxrenderer then the dispersion does not work. But when I change camera to another GLScene then the dispersion functions in the main GLScene. See in this video, when I change camera/scene, then the smoke moves randomly: https://www.youtube.com/watch?v=LBnG30PGgt0&feature=youtu.be
It started this behaviour when I updated to 1.5.
I am very confused!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, Daniel i've made a liitle test from the smoking demo (see attached zip) i added 2 GLScene and in each 1 camera et 1 object. I m also used GLNavigator/GLUserInterface and GLSimpleNavigation for testing camera movements and changes. All works fine. You surely forget or adding something in your code.
Just a question have you used the convert tool in lazarus for porting your project ?
I suggest you to compare your project with this simple sample. I'm sure you'll find :)
Great! Thank you, I will try your sample. If I make a new project it works, so it is surely something in my project.
Yes, I ported it using the Lazarus converter. Is there a better way?
Cheers!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok the problem come from the converting.
1st The tool include with Lazarus it's not perfect, and your code, come from GLScene 1.1 so some things are changed since. I sure some properties wasn't converted properly (DFM to LFM)
So the best way it's remake your project and start with new form. Add all the component set properties and assign the events and paste the code from Delphi in. It will be long, but like this you will be sure all are ok. I think it's the best choice.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello Daniel, i tried with a LensFlare, i've made some research and i found the "bug"
The problem come from the "Random function" it's seem the FPC's random function is not threadsafe so is why the Particle effect not work properly. So don't take care of this at this time. I'll make a patch with our own "Random generator".
Thanks :)
Cheers
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi guys!
I decided to try to move from my old Delphi 6 with GlScene 1.0 setup to either Lazarus or CodeTyphon.
My project is fairly big and complex, and I still cannot get it to run flawless in neither Lazarus or CT.
Lazarus 1.6x with GLScene 1.4 looks the most promising.
But I get a SIGSEGV error, and my game loads without any textures.
Transparent objects are also showing up.
Any idea what this problem can be?
It seems all my materialLibraries got reset. So I just have to add the txtures again.
Hi Daniel good news :) first i suggest you to use Lazarus 1.8 (actually 1.8RC5) rather tha CodeTyphon. Because codeTyphon ten to take an another way (no same file extension for example) and i'm only maintain GLScene For Lazarus. The actual SVN GLsCene LCL is partially synchronized with the actual Trunk (so it's GLScene version 1.5) Take care with image in some case they're not work properly due to the incompatibily with Delphi's TBitmap (i'm working on) some packages are not ready to use like ODE, Newtown, Cuda/OpenCL, Bass and FMod.
In my next update for cross compiling issues, the ODE, Newton, Bass, and surely deprecated FMod will be remove. I can list all the changes i do yet, it's huge but for example you'll can play OGG (only with 32bit scompiler) /Mp3 sound with OpenAL.
I'll make next update when Lazarus 1.8 Stable will out and i'll add GLScene to the OnlinePackage manager tool for esay an install.
Before try to move tour project just try convert some little part one by one and make some little sample to see if all work. It will be better for debuging and will can help me if you find bugs.
A Clue for textue take care the ImageClassName property is not "Blank Image" or "Pic File" set it to "Persistent Image"
And i'm just updating GLScene for Lazarus slowly because i've not many time to code and the second reason i'm working on a big project (a fork of GLScene for using OpenGL Core and Vulkan) so........
If you need some help with Lazarus post on the dedicated sub forum. Thanks
Cheers
Hi Jerome!
Yes, I'm very happy with the migration to Lazarus! Thank you for the recommendation!
I'm sorting out alot of little problems, some seems to be related to the change from Delphi to Lazarus.
And some problems seems to be the change from GlScene 1.0 to 1.5.
One thing I cannot understand is why the PFX Source FX randomization changed. In Delphi/GLScene1.0 my PFXSource had a position/velocity dispersion which worked. After the upgrade to Lazarus it does not work, same values. It seems to just mix between the extreme values. See screenshots:
Last edit: Daniel 2017-11-11
Hi Daniel ok, i'll check the PFXSource code and see what's wrong. Do you use Bitmap as texture for this FX ?
Hi Jerome!
I'm using the PerlinFXmanager for the FX.
If a make a simple test program with the Perlin, everything works fine!
So something in my main game is messing with the sourcePFX, in 1.5, which was not a problem in 1.0...
No idea what!
I'm checking the GLParticleFX.pas unit and i discover some incompatible things
1st : just try change near line 1680 change
by
And around line 1793 we have
and in GLScene 1.1 we have
the 2nd line disturb me, i must investigate and check this, because it seems wrong for me.
Pavel if you pass by here what do you think , about this line ?
Thank you for looking at this!
Unfortunatly, it didn't help to change the above lines....
In waiting, you can try the demo in \glscene\Samples\Lazarus\bench\smoking
There the dispersion works nice and randomly!
Something in my code must be the problem....
All the demos and samples works fine.
But something in my code or an object messes with the sourcePFXEffect dispersions.
When I use my main exterior camera in the same GLScene as the fxrenderer then the dispersion does not work. But when I change camera to another GLScene then the dispersion functions in the main GLScene. See in this video, when I change camera/scene, then the smoke moves randomly:
https://www.youtube.com/watch?v=LBnG30PGgt0&feature=youtu.be
It started this behaviour when I updated to 1.5.
I am very confused!
Hi, Daniel i've made a liitle test from the smoking demo (see attached zip) i added 2 GLScene and in each 1 camera et 1 object. I m also used GLNavigator/GLUserInterface and GLSimpleNavigation for testing camera movements and changes. All works fine. You surely forget or adding something in your code.
Just a question have you used the convert tool in lazarus for porting your project ?
I suggest you to compare your project with this simple sample. I'm sure you'll find :)
Last edit: Jerome.D (BeanzMaster) 2017-11-14
Great! Thank you, I will try your sample. If I make a new project it works, so it is surely something in my project.
Yes, I ported it using the Lazarus converter. Is there a better way?
Cheers!
Ok the problem come from the converting.
1st The tool include with Lazarus it's not perfect, and your code, come from GLScene 1.1 so some things are changed since. I sure some properties wasn't converted properly (DFM to LFM)
So the best way it's remake your project and start with new form. Add all the component set properties and assign the events and paste the code from Delphi in. It will be long, but like this you will be sure all are ok. I think it's the best choice.
I will give it a try and report back when I rebuilt the project with a new form!
Thanks again Jerome!
Jerome!!
Open the benchmark\Smoking demo, add a Lensflare to the scene. What happens for you??
Hello Daniel, i tried with a LensFlare, i've made some research and i found the "bug"
The problem come from the "Random function" it's seem the FPC's random function is not threadsafe so is why the Particle effect not work properly. So don't take care of this at this time. I'll make a patch with our own "Random generator".
Thanks :)
Cheers
Great news! I'm glad we found the bug!
Thank you Jerome! I appreciate your work on GLScene very much!
Hi i found a solution based on a new class with threadsafe RandSeed generator. It use XorShift64 algorithme (https://en.wikipedia.org/wiki/Xorshift and i'll add MCW256 (https://en.wikipedia.org/wiki/Multiply-with-carry ) later for more little bit accuracy; Show the result :
The code source will be updated soon, when the Final Lazarus 1.8 release will out.
Last edit: Jerome.D (BeanzMaster) 2017-11-18