Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Lunatix

Member Since 17 Dec 2010
Offline Last Active Dec 17 2012 10:11 AM

Posts I've Made

In Topic: Matrices, Lights, Objects - Transformation Question

05 September 2012 - 09:30 AM

Umm.. okay, this wasn't clear enough >_< I don't use any function of opengl, theese are my own functions, but i'd like to get them work as OpenGL 1.1 supported them.. it was more the question, if i'm right or wrong with my thoughts..

In Topic: How draws OpenGL to a Window Handle?

01 September 2012 - 04:10 AM

Hey!

Thank you Ravyne, these informations are very good Posted Image I will keep this in my mind, if i start with OpenCL.
And finally, i have managed to get my new library to work, and now, its about 10 times faster as before Posted Image

If someones interested, read more at our (LunaGameWorx) Blog site in the Raytracing section: http://gameworx.org/...acing-articles/

But i think, 740ms per frame is even slow, if i see something like this -> http://dinkla.net/de...p-parallel.html
In the Videos, if the application starts up, they are using only one thread for computing and git 8 Frames per secound! Once again, 10 times faster than mine.. are there some tricks to speed up calculations or function calls in c++ ? And, should i use float or double vectors? My vector struct has double's, because i thought, vectors should have good precision in a raytracer or rasterizer..

Edit: I switched to Release and /Os -> Now i have only 103ms per Frame and ~9Fps ! Awesome =D Maybe, i should write a bit more inline asm code in my vectors Oo
Edit2: Found the SIMD SSE2 Switch, now i'm at 13fps and 71ms per Frame!

In Topic: How draws OpenGL to a Window Handle?

30 August 2012 - 10:46 AM

samoth: In some cases, you're right - i shouldn't worry about it. But in my case, i want to get experience! I don't even want to look up at those people, who writes librarys like OpenGL or DirectX and think "Theese people must be some kind of gods *_* - no, i want to be one of those people, who know the mechanics behind the scene - just a little bit!

By the way, i got it working. I searched and found, my solution uses CreateDIBSection and BitBlt and other of those basic GDI functions. And, i think, it works good. After programming this i found an equally method in the SDL Source code :)

And now, i can call "wrtCreateContext(MyPanel.Handle);" from C# and my library does all the steps necessary to create a GdiPixelBuffer and a rtContext for drawing :)

In Topic: How draws OpenGL to a Window Handle?

30 August 2012 - 07:22 AM

When i got the raytracing working again, i will modify my raytracing code a bit and use OpenCL for computing. The thing was, that i had my own "Pixmap" which the final colors where drawn to - and i had to copy this colors (public struct RTColor) to the Bitmap via "MyBitmap.SetPixel(System.Drawing.Color, ..)". This took to long, and i don't wanted to write unsafe code, because i think, if i'm programming in a managed enviroment, one should not use unsafe code until no other solution is left.
So this point and the fact, that i had to do unsafe calls to get OpenCL to work with c# and the speed improvement of a c++ language lead me to this solution - to rewrite the Raytracers Core in c++.

And i don't think, C# is very good for such a type of project - because managing all those vectors, colors and rays by the GC is a (for me) to heavy performance lack (leak? lack?).

And my core is finished, and my first (because simpler) solution was a rtContext which has an abstract rtPixelBuffer class which it will output the final pixels. So, in C#, i call "wrtCreateContext(HDC DeviceContext)" via DllImports which creates a "GdiPixelBuffer" and the result is a valid rtContext with a rtPixelBuffer (GdiPixelBuffer)..

In Topic: How draws OpenGL to a Window Handle?

30 August 2012 - 12:30 AM

Very funny, powly K ;)

I don't wanted those kind of "direct" access, it was more a question, how OpenGL or DirectX brings the final pixels on the window, just to understand this technique. I tried something like: creating a panel and setting a bitmap as background image, then write to that image - this operation costs ~400ms (C#, my first raytracing approach was written in this, but now, i ported the code in C++ as a library for more speed). And because of this lack of performance, i thought i could get a bit more "direct" access..

PARTNERS