Hello,
I am Nicolas Lusa from university of Lugano and I am working on my master thesis with the supervision of Yuriy Tymchuk. Right now I am working with woden and I am trying to build polygons. Question1: Is it possible somehow to build polygons in woden? If not: I know woden is based on OpenGL and I also know that in OpenGL is possible to draw polygons with GL_POLYGON and a given array of points. Question2: How could I use GL_POLYGON through woden for my purpose? Moreover, I would like to put some sort of skybox in my scene. Apparently it's not possible yet, so my question is how could I do that? Thanks in advance. Cheers. Nicolas |
> On 16 Apr 2015, at 9:41 , Lusa Nicolas <[hidden email]> wrote: > > Hello, > > I am Nicolas Lusa from university of Lugano and I am working on my master thesis with the supervision of Yuriy Tymchuk. > Right now I am working with woden and I am trying to build polygons. > Question1: Is it possible somehow to build polygons in woden? > > If not: > I know woden is based on OpenGL and I also know that in OpenGL is possible to draw polygons with GL_POLYGON and a given array of points. > Question2: How could I use GL_POLYGON through woden for my purpose? > > Moreover, I would like to put some sort of skybox in my scene. Apparently it's not possible yet, so my question is how could I do that? > > Thanks in advance. > Cheers. > Nicolas IIRC, Woden is built on modern GL techniques, and GL_POLYGON is deprecated in 3.0, so I doubt it. Luckily, triangulation of polygons is pretty much a solved problem, though I don't know of any implementations in Pharo yet. Cheers, Henry |
In reply to this post by Lusa Nicolas
No idea, but let us know!
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
|
Uhh.. I Woden still developed? Because I thought that Object Profile was working on it. Otherwise maybe we should switch to the CodeCity engine… it seems to have more “support”. Uko
|
what is the codeCity engine? you want to reinvent all the effort ronie put in woden? Stef
|
In reply to this post by Uko2
> Uhh..
> > I Woden still developed? Because I thought that Object Profile was working on it. Otherwise maybe we should switch to the CodeCity engine… it seems to have more “support”. Ronie? Alexandre > >> On 16 Apr 2015, at 15:11, Alexandre Bergel <[hidden email]> wrote: >> >> No idea, but let us know! >> >> Alexandre >> -- >> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: >> Alexandre Bergel http://www.bergel.eu >> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. >> >> >> >>> On Apr 16, 2015, at 4:41 AM, Lusa Nicolas <[hidden email]> wrote: >>> >>> Hello, >>> >>> I am Nicolas Lusa from university of Lugano and I am working on my master thesis with the supervision of Yuriy Tymchuk. >>> Right now I am working with woden and I am trying to build polygons. >>> Question1: Is it possible somehow to build polygons in woden? >>> >>> If not: >>> I know woden is based on OpenGL and I also know that in OpenGL is possible to draw polygons with GL_POLYGON and a given array of points. >>> Question2: How could I use GL_POLYGON through woden for my purpose? >>> >>> Moreover, I would like to put some sort of skybox in my scene. Apparently it's not possible yet, so my question is how could I do that? >>> >>> Thanks in advance. >>> Cheers. >>> Nicolas >> > -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. |
Sorry for not answering, this email got buried under my inbox. IIRC, Woden is built on modern GL techniques, and GL_POLYGON is deprecated in 3.0, so I doubt it. By polygon, what do you mean?, an arbitrary concave polygon or a convex polygon? For a convex polygon, you only need to use what is known as a triangle fan. For a concave polygon, you need a constrained Delaunay triangulation, which is an easy to explain but hard to implement algorithm. I guess that GL_POLYGON only supports convex polygons. For the convex case, take a look here: http://en.wikipedia.org/wiki/Triangle_fan I think that the code should be something like this; builder := WDGeometryBuilder ... points := {}. points do: [:p | builder addP: ...]. indexBase = 1. 3 to: points size: [:i | builder addI: 1 i2: i - 1 i3: i3. ]. If you want the concave case, take a look into the incremental Delaunay triangulation algorithm. Then, into adding the constrains (edges of the polygon) to construct the constrained Delaunay triangulation. Now, this is a 2D algorithm, so the points have to be in a plane. Don even think on trying a 3D Delaunay triangulation, because it is for volumes and not surface, and it is hellish.
Currently I do not have time to work in Woden, but when I get more time, I will continue working on it. More time means after May, because of studies and a paper that I am presenting in ICSE.
Now, I do not want to add many more low level features to Woden, until I get a production ready version of Lowcode/uFFI, which is required to optimize some really performance critical sections of Woden. With Lowcode I am getting C like pointers in the VM with a small overhead in comparison with nbFloat32AtOffset: and nbFloat32AtOffset:put: . Pointers and C structures are required to fill buffers with an exact memory layout, which is required by OpenGL 2+ . The alternative to Lowcode or the NativeBoost x86-32 assembler, is to move significant parts to C++. Moving significant parts to C++ means a huge loss of flexibility, and it means a completely different engine. Completely different, because I have been reading about more modern game engines, and better design patterns such as Entity Component System. Anyway, one of the first thing that I am going to do when coming really back to Woden, is to move it to GitHub. By using git I can fix some part of the native library dependency hell. Bullet is used for physics it is written in C++, and I am definitely not going to rewrite in Smalltalk. Moreover, I would like to put some sort of skybox in my scene. Apparently it's not possible yet, so my question is how could I do that? Skyboxes are in my TODO list. My biggest problem with sky-boxes are in loading the cube map texture. A cube map texture is actually a single texture that has six faces. The six faces of a cube. Skybox support requires loading a cube map texture, and then using a special material for the sky with a special shader. I am going to try getting a demo working in the weekend, it should not be very complicated. It also gives me a good opportunity to rewrite the shaders. I found a better way to embed shaders when working in the VirtualGPU, by using the GTInspector. you want to reinvent all the effort ronie put in woden? It is more probably that the one reinventing and being successful would be myself. Graphics programming is really hard, specially if we are doing it in a completely dynamic language as Smalltalk or Pharo. I have learned valuables lessons by reinventing my game/graphics engine several time, and studying long time ago others game engines, such as the good old Quake engine. Woden is not my first or second graphics engine, I have already lost the count. I think it is about my sixth/seven engine. And I still think that there's a lot of room that I have improve, without rewriting everything. Do not expect to see a AAA game engine written completely in Pharo or Smalltalk. The optimizations done in AAA engines simply cannot be done in Smalltalk. They are designed with simple data structures that are optimized to work well with CPU caches. There is also some heavy inlining done by the C/C++ compiler. No garbage collection, just manual and deterministic memory management. If you want to make a new engine, please be aware that the graphics landscape is becoming quite interesting. Specially because this year we are going to see Vulkan, which is the successor of OpenGL, and Direct3D 12. Those new graphics API are said to be very low level in comparison with OpenGL. According to Valve ( http://www.phoronix.com/scan.php?page=article&item=valve-lunarg-vulkan&num=1 ), writing a graphics engine for Vulkan is similar to writing a graphics driver or developing for consoles. All of this requires heavy support for pointers a la C. Best regards, Ronie Salgado 2015-04-16 18:24 GMT-03:00 Alexandre Bergel <[hidden email]>: > Uhh.. |
Hi ronie
Yes people should read and learn :).
JB is adding shadders :) and a ci server. He is improving the shadder versionning because he got blocked on mac. All the code we do for the Thales project will be pushed back into Woden. Thanks for this great software. Nice nice nice. JB did you commit your changes?
Excellent. Keep pushing. Argh.
|
In reply to this post by stepharo
No, our aim is not to create a 3D graphics framework. But we meed to draw 3d boxes and few more entities somehow. I’ve mentioned Codecity because it’s usually easy to get a response from Ricky and at the moment of written, I was really perplexed with the answer. I’m not expecting code owners to do someone else’s job. For example Ronie’s answer was really cool. But if someone would tell that Ronie ran away and no one knows how Woden works - it’s ok too, as different things happen. But imagine that you ask: “Does QualityAssistant fix critics automatically?” and Michele answers: “No idea, but you should check and let us know” Maybe I am expecting too much responsibility, in this case please forgive me. Uko
|
I have just added a simple skybox support. Check the modified WDFPSSimpleExample6 as for how to use it. To embed the images, I am using the following utility in the playground: WDExamplesData storeCubeImageFromFile: 'quickMountain' extension: '.png' dataMethodName: #quickMountainSkyData imageMethodName: #quickMountainSky Which embeds quickMountain_px.png, quickMountain_nx.png, quickMountain_py.png, quickMountain_ny.png, quickMountain_pz.png and quickMountain_nz.png . The generated WDExamples >> #quickMountainSky method returns an array with 6 forms in the same order, which is used to construct a WDTextureCube Best regards, Ronie 2015-04-18 17:39 GMT-03:00 Yuriy Tymchuk <[hidden email]>:
|
Thanks Ronie this is what I was looking for! Amazing going to try it out today and see how it works.
For what concern polygons I knew about the algorithms (thanks for mentioning them anyway), was just looking for a "more straight forward" solution since rendering polygons isn't the main goal of my thesis which means I have others priorities.
Thanks again,
cheers.
Nicolas
On Apr 20, 2015, at 7:56 AM, Ronie Salgado <[hidden email]>
wrote:
|
In reply to this post by Ronie Salgado
Thanks Ronie! Cool stuff.
|
Free forum by Nabble | Edit this page |