-
Content Count
39 -
Joined
-
Last visited
Everything posted by Vincent Gsell
-
Yes, it is an option, but it not the same thing ! In this demo, a texture is used as a color Palette : This work well in 2 situations - huge number of vertices - small change of color value between same face's (i.e. triangles) vertices In this demo, it is masterized, and work well. In fact, this technique could be used, but is usually used to fix the very same color at an entire "face", else, you got color distortion effect. The "Color0" buffer, is not same things : Color is not indexed in a texture, but directly assigned "in/near" the vertex data (please see the code in the capture). The hardware will then set a linear color distribution between vertices. This work well in the situation of "great" space between vertices (zoome situation, typically) In fact, technicaly, it is not the same memory bandwitch : Color0 can take more memory than a texture, it depends. It is linked too on the use case and final render that we need. In map, scientific image or chart, the color index is usually used. @JackT : If used a texture could match, you do not have to rewrite a shader, but it depends what do you need : In the description of your use case, I interpret it as the need of linear color rendering.
-
When you use skia directly, this interface come very quickly, and it will more easy to call. As I said in my first message, I do not remember if tskSVG component have an Image property : Certainly not, if you do not see it : But the code is interesting to see, again, in VCL.Skia.
-
Hi In fact, to draw it properly on a Bmp, there are some init and code to add : The technic to pass the proc allow you (not only, but it is uses as is) to concentrate yourself to your drawing process. I invite you to go to the implementation in FMX.Skia or VCL.Skia, to see what is done. (If you do not have source code, it is available github) -> In the code, IksCanvas comes directly for a Bitmap helper class, wich introduce the canvas from a dedicated surface. And again, the skia integration is very well done, because "high level" code between 2 framework is very same. -> So, here is the code you need to transfert your svg to your "vcl" control (I do it on VCL framework, it's been a long time that I do not open a new projet on it :)) uses System.IOUtils, //files. System.Types, //RectF System.Skia, VCL.Skia; Procedure Transfert; var LBitmap: TBitmap; begin LBitmap := TBitmap.Create(100, 100); try LBitmap.SkiaDraw( procedure (const ACanvas: ISKCanvas) var LSvgBrush: TSkSvgBrush; begin LSvgBrush := TSkSvgBrush.Create; try LSvgBrush.Source := TFile.ReadAllText('..\..\..\samples\panda.svg'); LSvgBrush.Render(ACanvas, RectF(0, 0, LBitmap.Width, LBitmap.Height), 1); finally LSvgBrush.Free; end; end); finally //Transfert into an VCL Control Form59.Image1.Picture.Assign(LBitmap); FreeAndNil(LBitmap); end; end; procedure TForm59.FormCreate(Sender: TObject); begin Transfert; end;
-
Right. https://docwiki.embarcadero.com/Libraries/Athens/en/Vcl.Skia.SkImageToBitmap On the same manner, the first link (github doc) is fully compatible with VCL. A great effort has been made in skia to support well the 2 frameworks.
-
Doc on Skia Github page contains usefull code to convert svg to bmp : https://github.com/skia4delphi/skia4delphi/blob/main/Documents/SVG.md From an skia's image (do not remomber if available from skSVG. https://docwiki.embarcadero.com/Libraries/Athens/en/FMX.Skia.SkImageToBitmap
-
As far as I know, yes. In fact, the only mention of "color0" buffer pipe part is used in FMX.Canvas.GPU. None of TMesh declaration use it. So, I'm pretty sure that vertice's indexed color is not implemented shader side. In fact, it is a little bit weird, but it is undestandable because of memory bandwitch needed in this type of colored mesh. Yeah, it is certainly one of the best source actually ! (it is in GitHub too) - At the time I did this, it was mainly based upon the Embarcadero demo "lowlevel3d", wich is a bit more complex/less documented π Personnaly, it make me happy to retrieve this code, I will certainly convert it on grijjy methodology, clean it up, remove old support lib, and perhaps put it on my git.
-
TDummy will apply it transformation matrix to its childs. So, not a way directly. Is this linked to your 3MF post ?
-
Hi, I am sorry, your project does not give result on my side. (range error and va..) Back to october, I work a little on that, with the dll and your header, but restart from scratch, with my tools. With exemple provide by the site, and docs I found on it. -> Actually, It's far from complete, but I got now model rendered correctly, on scale and positionning. - I do not support beamlatice and slice. - material (indexed and ressource color, as well as textured one) should be supported later. Here is a capture bellow : Are you more or less advanced ?
-
Retrieve my code, dig in paleo stuff of last decade π Is that do you need ?
-
Wow : I do not see that you use a "TRectangle" as base object : I Apologize because your "name" issue become evident !! your childs objects, depending of their types, could lead to problem -> Have you *any* reason to not use a "real" FMX TFrame instead ? I see you do that on a first attempt, are you sure that you have not doing something wrong ? TFrame class (The real one, not your Rectangle inherited !) is exacly matching what your are trying to do, and in this case, naming is managed, because TFrame is an "isolated" class, as TForm.
- 17 replies
-
- fmx component
- onclick not firing
- (and 1 more)
-
Hi ! Short answer : No, afaik. But it is very possible. In fact, there are 3 things to do : 1 - Build a TMesh descendant, with "Color0[index]" affected (near vertices). (You certainly do it for your project ?) 2 - You cannot use "standart" TMesh, because they are build with this VertexBuffer : FVertexBuffer := TVertexBuffer.Create([TVertexFormat.Vertex, TVertexFormat.Normal, TVertexFormat.TexCoord0, TVertexFormat.BiNormal, TVertexFormat.Tangent], 0); FIndexBuffer := TIndexBuffer.Create(0, TIndexFormat.UInt32); As you can(not) see there is a lack of TVertexFormat.Color0 in the stuff. So, when you build your new mesh, make a meshData.ChangeFormat to include it. 3 - Here is the "hard" part. As we change the vertexBuffer format, the materialSource will not be compatible anymore. It's not an issue, because all of them do not process Color's vertices indexed buffer (because they are directly linked to the TVertexBuffer's format). -> You have to do your own MaterialSource, which take care of that data. If your have an exemple of a mesh, I can see if I can adapt an old MaterialSource that I commited years ago π Vincent
-
You can put frame's name property at blank : No more "name" problem. The issue "3 times" is weird π
- 17 replies
-
- fmx component
- onclick not firing
- (and 1 more)
-
Hi, Yeah, sure : Check Afterwarp, you'll find precompilated demo that match water and glass that your are looking for π If your are looking to do a "industrial type" (i.e. pro grade software for visualization) 3d rendering app, it can definitely match. But, once again, achieve high quality "PBR" rendering, requiert a lot of work on model, texture and so on : It is not really an issue localized on a 3d engine backend (if your 3d engine can handle shader correctly), but a source and assets "issue". Source assets files are important, and it is a matter of shader, texture quality, model resolution : See CGE'exemple based upon gLTf 2.0. But it's right that it move the amount of work on model creation, not in the code. π Yes, it's right : Transformation matrixes for camera/view and world are more or less locked on FMX. It's a *severes* weaks. The only way to change init transpormation pipeline is to work on TForm3D in an From3dOnRender event. You can see that on a @Paul TOTH exemple here Let me know if you can move forward, or what your are doing (in PM) or if you need more info. Vincent
-
Gaining access to private class vars of an implementation class
Vincent Gsell replied to Eric Grange's topic in RTL and Delphi Object Pascal
I ignored that organization exists ! Where I sign up ? π -
Hi Peter, If you want full pascal 3d engine, CGE is still a good candidate, and can do realistic images. Afterwarp is very good too, more industrial goal, and it is distribute as a lib, and is written in c++. It is distribute with a clean wrapper and an high level pascal objects lib available for delphi and fpc. Wrapper is available since 3.0 for c# too. So, it depends of your goal (wich langage) but not really on rendering result. Note : I had download just a few minuts ago Afterwarp file, and BitDefender(Microsoft defender effectively react as a malware. But is is definetely a false positive. I check the sha1, it is very same objet rom weeks ago, and I recheck the decompressed content on other virus check (virus total) and only bitdefender reacts. False positive π Scuse me but I do not undestand what do you say when you say that CGE is not "realistic enough" ? IHMO, Realistic rendering is not really matter of 3d backend end, but, on a classical raster 3d engine, it is more a matter of shader, mainly (and texture, more basically). Outside the 3d backend, you can go to a variety of technics to achieve a realistic rendering, such as cloud point reconstruction (scalar fiels reconstructrion on high resolution) or cloudpoint splatting rendering,see @Eric Grange's great exemple on delphiTools web site yesterday !) , or even raytracing on high end hardware. So, if you want to make "realistic" on CGE, it is possible @Michalis Kamburelis done exemple on that : See for exemple gltf object handling, which is great. in fact, you can even obtains "correct" result in FMX3D, with simple obj and correct texture handling (photogrametery technics) or working in a more depth technics, witch advanced shader composition. Could you please just give more details of what is your goal or what kind of 3d results you want to target ? Thanks ! Vincent
-
Demo project Samples\Object Pascal\Multi-Device Samples\User Interface\ListCollections\ListCollectionsSampleProject.
Vincent Gsell replied to dmitrybv's topic in FMX
Hi, Not sure I understand well, because this demo is, on my side (D12), a demo of Expression parser for live binding... In fact, perhaps is is not really the subject, but if the problem is to link a dataset to a TListBox, I tryed just a week ago, and it was not very clear firstly, but now, I can do it quickly : Hope this will help you ? - Drop your TListBox - Drop your TClientDataSet (push a field or 2 inside) -> CreateDatSet - Drop your TDataSource (but it's not a mandatory) - In liveBinding, the "secret" is to link the 2 "Synch" parts : The one of the TClientDataSet with the one of the list. - then, link desired Field from TClientDataSet into TListBox.Items.Text Normally, you'll got a prompt that indicate it will create for you a TBindSourceDB and a BindingList with TLinkListControlToField. Once this done, run and add record in your TClientDataSet, and it should appear in TListBox. Hope this help, Vincent - Above, my test app, starting only with Dataset and client DataSet, and a TPrototypeBindSource which is a more direct way (and fun) to display information. -
juste a side note : I tryed to just initialized the wrapper with last unit, and found somes glitches very quickly (AV on D12 on GetReleaseInformation) : For exemples : function TLib3MFWrapper.GetPrereleaseInformation(out APrereleaseInfo: String): Boolean; var ResultHasPrereleaseInfo: Byte; bytesNeededPrereleaseInfo: Cardinal; bytesWrittenPrereleaseInfo: Cardinal; bufferPrereleaseInfo: array of Char; begin ResultHasPrereleaseInfo := 0; bytesNeededPrereleaseInfo:= 0; bytesWrittenPrereleaseInfo:= 0; CheckError(nil, Lib3MFGetPrereleaseInformationFunc(ResultHasPrereleaseInfo, 0, bytesNeededPrereleaseInfo, nil)); SetLength(bufferPrereleaseInfo, bytesNeededPrereleaseInfo); CheckError(nil, Lib3MFGetPrereleaseInformationFunc(ResultHasPrereleaseInfo, bytesNeededPrereleaseInfo, bytesWrittenPrereleaseInfo, @bufferPrereleaseInfo[0])); Result := (ResultHasPrereleaseInfo <> 0); APrereleaseInfo := String(@bufferPrereleaseInfo[0]); end; Before the last line, i'll put a basic begin [...] Result := (ResultHasPrereleaseInfo <> 0); If Result then APrereleaseInfo := String(@bufferPrereleaseInfo[0]); end; This should avoid AV if you access the string passed by var in this call...
-
Sounds nice ! I look further into the unit's Wrapper, and it is quite complicated ! Honestly, the TLib3MFPolymorphicFactory made my day. π --> Please, It will be cool if you can post your basic demo again using this "final" Wrapper ? Perhaps only the code to build an FMX3D object with this wrapper ? thx, Vincent
-
Hi As I see, you have now correct FMX 3d project, good point. π I understand your direction, but now it is not the same problem : You tryed to rebuild an "official" header unit and it is not a way that I would fellow personnaly. (in a update/support effort long-term perspective) --> Have you try to use directly the *original* unit with fpc instead of delphi (as it is apparently write for fpc, actually) to see if you succeded to read your file correctly (I would make a simple fpc console app, which read and convert the 3MF file as needed) ? And if it work, you have several solutions : - Adapt this unit to work with delphi (beware of type - perhaps it is better to try conversion tools such as Yunkot one or Chet one . - Alternatively, work on a personalized and simplified dll in C or FPC directy, which consume the *original* dll with correct and, above all, well supported header.
-
Hi David, I do not look reading/parsing part, but 3d can not work as is : It missed several things. Not specially in order : - There are no viewport : If you do 3d app on "standart" FMX window (2d canvas), you must add a viewport (TViewport3D). - You can not use TModel as is, it is a pure loading object : In fact, do not use TModel3d π use mesh collection instead. - The dpr try to include a "*.windows.fmx" which break the project on opening step. Not a nice way for onboarding π - After corrections in 3d part, here what I can say : ---> I believe there are some caveat in your "multi object reading". It is loading, but object are broken (missed processing init for sure) ---> In single mesh, There are some issues in scaling (which is certainly in the file !) ---> Beside that, In Single mesh, it generally load a the object correctly ! - Above, some pictures, far to be perfect, but hope that help. - Note that, surprisingly, MSPaint3D handle very well this kind of file. I use it for my test. - You will find somes FMX3D examples under my github here, could perhaps help you on certain FMX3D behaviours. - Note for next time : --> Please indicate your dependancy : the OXmlSAX unit came certainly from here ? - It should be cool to indicate that, in order to easely find dependancy. --> Why not included a basic 3mf file to reproduce your problem ? for testing your "multiobject" ? Vincent Unit1.fmx Unit1.pas
-
Hi No stupid question. FMX Real world measurement : There are not. You decide. π It is a matter of scale. In your example, for a room/floor, you can *arbitrary* fix 1 FMX unit for 1 meter, for example. So, in this case, you will working in your 3d FMX project in meter. The Proportion will alway be correct, whatever the real world unit you will apply. As a side effect or working with scale, we can note : --> Real world unit will be important when you will have to convert potential import/export 3d object to your/anoter coordinate (scale) system. for exemple, taking a turbosquid (or whatever) object and import it into your "world", will lead you to put, after loading, a code such as : MyImportedObject.Scale.point := point3d(lConversion,lConversion,lConversion); --> In fact, depending what project you are modelizing ("human" scale (as your exemple), molecular scale, maps (GIS) Scale or event inter-planetary space scale) you will have to adapt FMX unit scale to your target world normal metrics (and vice-versa). --> Technical tips : FMX 3D allow you 1000 unit of camera visibility, so, if you want to modelize a "city" map, for exemple, you'll certainly fixed a scale such as 0.001 FMX unit for 1 meter irl, for exemple. Hope this help
-
An hommage to all Spline lovers ...
Vincent Gsell replied to Rollo62's topic in Algorithms, Data Structures and Class Design
Stunning ! Thx for the post ! Fellowed Freya on Twitter/X for a while, she wrote "shapes" (if I remember well) which is an outstanding lib on Unity. Her video on algebra for game is very cool too. -
Hi ! - D7 VCL to D11.3 FMX : what a huge jump. π ! - just tested under a blanck 11.1 fmx app : I do not have the problem. Event trigered without system beep (I put just a showMessage in the event ). Could you teste in a same way under 11.3 ? (blanck app) - Have you something special in the event ?
-
WEB Standalone console APP βIndy httpβ in production ?
Vincent Gsell replied to borni69's topic in Network, Cloud and Web
Hi ! Idem ! We have Indy based tenant : Prod logs 60 connections "average" (so, 60 connections threads), with no problem at all. As a detail, we have Nginx on front, fine configured, with geoip and ip2fail and few other tools. (Delphi servers have not to deal with server side ssh currently) Architecture detail : Server only manage connections and context : it communicates throught our bus with "services" (which is standalone delphi linux console app) which perform workers duty. The Servers do not perfoms business stuffs directly. -
Subscribe to a web stream and listen to incoming streams
Vincent Gsell replied to p-samuel's topic in Network, Cloud and Web
Warning : Very "quick and dirty as a "One min programming challenge ";) -> joke appart : - you can mimic the pythonic "resp.iter_line" : Just wrap in a TThread descendant all what is done in screen capture. (Put the http and idssl component in the TThread descendant) - And on each "get stream" (onWork summoning), qualify the "new line", and send it on your main thread. - Avoid use of AnonymousThread here, it was just to make it quicky'n dirty.