-
Content Count
39 -
Joined
-
Last visited
Community Reputation
11 GoodTechnical Information
-
Delphi-Version
Delphi 12 Athens
Recent Profile Visitors
14662 profile views
-
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