Quad-ren 2d Graphics Engine


DaveC said:
Hessiess said:
[*] Bilinear filtered rotation: and scaling: Quads can be scaled and rotated
smoothly, without the shimmering associated with nearest neighbour filtering.
Ok so this means that instead of getting a pixelly looking image you get a blurry one.

That may be an ok tradeoff for some but to me using native resolution for a game (especially 2D hand drawn art) still looks much nicer than a bilinear blurred out one.


Use the largest images that the amount of ram will allow, Computers these days aren't exactly short of ram;). Blocky scaled images aren't exactly beautiful ether ;)
Anyway, if you do want nearest nabhour scaleing, you only need to change lines 78 and 80 of 'qr_sprite.cpp', I may add it as a feature if there is enough demand.
 
Last edited by a moderator:
Hessiess said:
The renderer is effectivly a global resource manager, as it directly or indirectly stores pointers to everything, and will handle object deletion when the renderer is destroyed.
Hm ... but in the example in the manual.pdf file, all objects are manually destroyed before the renderer is.

QUOTE
Use the largest images that the amount of ram will allow, Computers these days aren't exactly short of ram.

But the images are stored on the graphics RAM, which is smaller then the RAM of the computer.
 
Last edited by a moderator:
Jan-Nik said:
Hessiess said:
The renderer is effectivly a global resource manager, as it directly or indirectly stores pointers to everything, and will handle object deletion when the renderer is destroyed.
Hm ... but in the example in the manual.pdf file, all objects are manually destroyed before the renderer is.


Like i said, it will, probably in the next relese(the renderer is being re-written to make it more effeshent and modular)

QUOTE

QUOTE
Use the largest images that the amount of ram will allow, Computers these days aren't exactly short of ram.

But the images are stored on the graphics RAM, which is smaller then the RAM of the computer.


Currently only the frame being rendered is stored in VRam, and is re-generated every time the frame is changed.
 
Last edited by a moderator:
DaveC said:
Hessiess said:
[*] Bilinear filtered rotation: and scaling: Quads can be scaled and rotated
smoothly, without the shimmering associated with nearest neighbour filtering.
Ok so this means that instead of getting a pixelly looking image you get a blurry one.


Pandora supports OpenGL ES, the fastest will be if you let the hardware do the rotation and scaling for you. Just create a 2D texture and transform it. OpenGL is fast in 3D, but even faster when you do only 2D. You may get a great speedup, less battery consumption, etc...
 
Last edited by a moderator:
cosurgi said:
DaveC said:
Hessiess said:
[*] Bilinear filtered rotation: and scaling: Quads can be scaled and rotated
smoothly, without the shimmering associated with nearest neighbour filtering.
Ok so this means that instead of getting a pixelly looking image you get a blurry one.


Pandora supports OpenGL ES, the fastest will be if you let the hardware do the rotation and scaling for you. Just create a 2D texture and transform it. OpenGL is fast in 3D, but even faster when you do only 2D. You may get a great speedup, less battery consumption, etc...


That's basically what im doing, the pipeline looks something like this:

create quad mesh -> transform mesh -> map frame texture to transformed quad -> render

I estimate that the example prog is currently running at around 500 FPS on my laptop(2.66GHz dual underclocked to 1000MHz, 2 gig ram, GForge Go 7200, Arch Linux), that should improve substantially with the new optimised renderer.

Any comments on the logo? (see signature), I know the 'n' is a bit too wide ;).
 
Last edited by a moderator:
cosurgi said:
DaveC said:
Hessiess said:
[*] Bilinear filtered rotation: and scaling: Quads can be scaled and rotated
smoothly, without the shimmering associated with nearest neighbour filtering.
Ok so this means that instead of getting a pixelly looking image you get a blurry one.


Pandora supports OpenGL ES, the fastest will be if you let the hardware do the rotation and scaling for you. Just create a 2D texture and transform it. OpenGL is fast in 3D, but even faster when you do only 2D. You may get a great speedup, less battery consumption, etc...


Actually if you are just doing 2d , you would be much better of doing your transformation in software because it will be much, much cheaper submitting a large buffer of quads with pretransformed vertices ,identity model transformation and simple view transformation than to go thru OpenGL ES API layer for each quad.

In other words , if you are rendering say 500 sprites ,batching each one individually, your code will end up being dog slow.

PS.

Actually same thing applies to 3d but it is especially important for 2d graphics where each sprite ends up being just 2 triangles.
 
Last edited by a moderator:
warmi said:
cosurgi said:
DaveC said:
Hessiess said:
[*] Bilinear filtered rotation: and scaling: Quads can be scaled and rotated
smoothly, without the shimmering associated with nearest neighbour filtering.
Ok so this means that instead of getting a pixelly looking image you get a blurry one.


Pandora supports OpenGL ES, the fastest will be if you let the hardware do the rotation and scaling for you. Just create a 2D texture and transform it. OpenGL is fast in 3D, but even faster when you do only 2D. You may get a great speedup, less battery consumption, etc..


Actually if you are just doing 2d , you would be much better of doing your transformation in software because it will be much, much cheaper submitting a large buffer of quads with pretransformed vertices ,identity model transformation and simple view transformation than to go thru OpenGL ES API layer for each quad.

In other words , if you are rendering say 500 sprites ,batching each one individually, your code will end up being dog slow.

PS.

Actually same thing applies to 3d but it is especially important for 2d graphics where each sprite ends up being just 2 triangles.


All vertex transformations are done in softwere, quads are sorted by texture(in the new renderer), then all quads using the same texture are rendered at the same time. Though the original reason for this was to improve portability, it should also be faster as you are saying.

Currently im expecting to release Quad-Ren 0.2 sometime over the weekend, a lot of features have mean added, such as a proper resource manager, the ability to un-register quads and the capability to render 2D polygon meshes(circles and the like).
 
Last edited by a moderator:
Ive finally found the bug which has bean causing the new renderer to segfault, I forgot to replace:
CODE

inline qr_quad_manager *get_resource_manager()
{
return (qr_resource_manager*) this;
}



from the old renderer, with:
CODE

inline qr_resource_manager *get_resource_manager()
{
return (qr_resource_manager*) r_manager;
}



Proving yet again that the stupidest mistakes are always the hardest to spot :D .
 
You know what Quad-Ren needs? SVG file import capabilities.

I have an SVG file filled with graphics .. each object, by 'id', is then imported into Quad-Ren and given the same name as the id - so my object 'Player' is a Quad-Ren polygon, etc. This would, simply, rock ass...
 
torpor said:
You know what Quad-Ren needs? SVG file import capabilities.

I have an SVG file filled with graphics .. each object, by 'id', is then imported into Quad-Ren and given the same name as the id - so my object 'Player' is a Quad-Ren polygon, etc. This would, simply, rock ass...
Good idea, does SVG support vertex key frame/bone animation by any chance?
 
Last edited by a moderator:
Hessiess said:
torpor said:
You know what Quad-Ren needs? SVG file import capabilities.

I have an SVG file filled with graphics .. each object, by 'id', is then imported into Quad-Ren and given the same name as the id - so my object 'Player' is a Quad-Ren polygon, etc. This would, simply, rock ass...
Good idea, does SVG support vertex key frame/bone animation by any chance?


SVG doesn't inherently support animation - it is manipulated by externals (IE Javascript, C++, etc) to achieve the animation.

On that note, SVG support would be amazing. I don't expect it would be an easy thing to achieve, considering the versatility of the SVG file format and what it can define.
 
Last edited by a moderator:
'Dr.PHP' said:
'Hessiess' said:
'torpor' said:
You know what Quad-Ren needs? SVG file import capabilities.

I have an SVG file filled with graphics .. each object, by 'id', is then imported into Quad-Ren and given the same name as the id - so my object 'Player' is a Quad-Ren polygon, etc. This would, simply, rock ass...
Good idea, does SVG support vertex key frame/bone animation by any chance?


SVG doesn't inherently support animation - it is manipulated by externals (IE Javascript, C++, etc) to achieve the animation.

On that note, SVG support would be amazing. I don't expect it would be an easy thing to achieve, considering the versatility of the SVG file format and what it can define.


Part of SVG would be a good format for the collision mesh, which I am thinking of creating with bezier curves, as they scale well. the only problem is animation, JavaScript is out because that would be way too time consuming to implement. Currently im thinking of using interpolated vertex key frames for animating the collision mesh, it is currently looking like Im going to have to wright my own editor for this.

I have Quad-Ren 0.2 almost ready for relece, but the documentation needs updating, which is going to take a few more days. Should I relece now with a example program, and update the documentation later. Or push back the relece a few more days and re-wright the docs?.
 
Last edited by a moderator:
Any comments on my new example program for Quad-Ren 0.2, sorry about the code tags, the forums playing up.

CODE
http://www.hessiess.dyndns.org/files/quad-ren_example.png
 
Back
Top