MeshTriangle
Moderator: Moderators
MeshTriangle
A MeshTriangle Component would be convenient.
K
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
Well,
Even more convenient would be a mode dropdown ( Points, Lines, LineStrip, LineLoop, Triangles, TriangleStrip, TriangleFan, Quads, QuadStrip, Polygon ) on the Mesh component, in combination with a MeshVertex Component. Then you can do everything .. point-clouds, outlines etc.
Anyway, a MeshTriangle component is for example useful for terrains .. right now you need to add individual BoxMesh ( 2D ) Components in a loop and rotate them depending on how you want the "Quad" to be split. Another obvious use is importing during runtime
Properties for the Texture Coordinates and Normals of each vertex would be handy too ( otherwise you still need to use a MeshExpression with multiple if-statements ).
K
Even more convenient would be a mode dropdown ( Points, Lines, LineStrip, LineLoop, Triangles, TriangleStrip, TriangleFan, Quads, QuadStrip, Polygon ) on the Mesh component, in combination with a MeshVertex Component. Then you can do everything .. point-clouds, outlines etc.
Anyway, a MeshTriangle component is for example useful for terrains .. right now you need to add individual BoxMesh ( 2D ) Components in a loop and rotate them depending on how you want the "Quad" to be split. Another obvious use is importing during runtime
Properties for the Texture Coordinates and Normals of each vertex would be handy too ( otherwise you still need to use a MeshExpression with multiple if-statements ).
K
Yea I know, that's why I requested MeshTriangle .. since that's probably allot less work.The problem is that ZGEs internal mesh-format is limited to triangles.
Wouldn't there be a significant performance difference between a "scripted" loop ( reading / assigning all values from a Array ) and using the Mesh component? And VBO's will probably not be possible that way either, right?
K
The performance would be similar to that of the MeshNet component. So it would not be suitable for a rendering a large terrain but it could still be useful for effects. Still, the benefit of doing this with a component compared to using Opengl-external library is questionable imo because it is quite straightforward to achieve with normal scripting + external library.
The question is which is faster for rendering mesh that requires vertex updates each frame:
1. rendering with external opengl-calls
2. regenerate the mesh using RefreshContent and render using RenderMesh
Even though the second method can use VBO:s I wonder if the additional time of regenerating the mesh won't give a total time similar to method 1? At least if you are only rendering a single instance of each geometry.
Of course there is also the additional possibility of using geometry shaders. Maybe I should investigate that again instead?
1. rendering with external opengl-calls
2. regenerate the mesh using RefreshContent and render using RenderMesh
Even though the second method can use VBO:s I wonder if the additional time of regenerating the mesh won't give a total time similar to method 1? At least if you are only rendering a single instance of each geometry.
Of course there is also the additional possibility of using geometry shaders. Maybe I should investigate that again instead?
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
One reason I would like to see MeshTriangle, Line, and such in components rather than DLL calls is for OSX,. as those will not work, right?
Perhaps a Model AND a Render component would make sence,. as I can see uses for each, Render for animation stuff,. and the other for static model constructions,.. .
Perhaps a Model AND a Render component would make sence,. as I can see uses for each, Render for animation stuff,. and the other for static model constructions,.. .
iterationGAMES.com
Code: Select all
function Platform_LoadModule(const Name : PAnsiChar) : integer;
begin
//TODO: module support
{$if Defined(Linux) or Defined(Darwin)}
Result := Integer(dlopen( Name, RTLD_NOW));
{$else}
Result := 0;
{$endif}
end;
function Platform_GetModuleProc(Module : integer; const Name : PAnsiChar) : pointer;
begin
//TODO: module support
{$if Defined(Linux) or Defined(Darwin)}
Result := dlsym(Pointer(Module), Name );
{$else}
Result := 0;
{$endif}
end;
K