Sign in to follow this  

radiosity memory failure + artefacts

This topic is 3291 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I wrote a little radiosity renderer and now i'm facing following problems : with more than 10000 triangles the program crashes after some time (when half the computation is done) and windows reports that the virtual memory pagefile is overloaded and should be increased. BUT the taskmanager says that the memory load is constant at some value < 20mb.. the other problem is that i get artefacts when light shines through very little gaps between polygons. (they come from slightly different gradients of edges when an edge doesn't share exactly the same vertices. but sometimes light shines also through vertex sharing edges) I tried nearly everything about the texture mapper, but this didn't solve the problem. May subpixel accuracy solve this ? any other opinions about this ? (I use bright lightsources for point lightsources with values in the upper integer range, i use exposure function after rendering to compensate for that. the first problem is the most important one . thanks in advance

Share this post


Link to post
Share on other sites
Quote:
Original post by psycoding
with more than 10000 triangles the program crashes after some time (when half the computation is done) and windows reports that the virtual memory pagefile is overloaded and should be increased. BUT the taskmanager says that the memory load is constant at some value < 20mb.
This first question is probably a better fit for the general programming forum, but even so, you haven't really given enough information to go on. I will point out that the task manager is a notoriously inaccurate way to measure anything. Also, the fact that your application only has 20 MB of RAM active at any one time does not imply that it only uses 20 MB - it could have a gig or two of virtual memory sitting on disk.

Share this post


Link to post
Share on other sites
You'll have to give us a lot more information if you want reasonable help. What kind of radiosity ? Matrix, progressive refinement, stochastic ? How did you implement it ? How did you solve the form factors, rasterization or raytracing ?

Quote:

the other problem is that i get artefacts when light shines through very little gaps between polygons. (they come from slightly different gradients of edges when an edge doesn't share exactly the same vertices

This is called a T-junction or a T-edge. It's an absolute no-go in computer graphics. There is no way to solve artifacts that arise due to T-junctions, other than completely avoiding them.

Share this post


Link to post
Share on other sites
The engine is based on a triangle (texture) mapper.
It uses straight vector math.
Every object (i only use pointers) is destroyed as early as possible.
Radiosity is implemented the following way :
every triangle requires rendering the whole scene with an 180° fov.
the resulting image for each triangle is interpreted as light falling to it.

you said that it could use much virtual disk mem although little ram is used.
is there a way i could force the programm to uses ram only ?

I don't know what else I could write about the program, so here's the source code :

sorry, i post it later, the version that i have with me is too old. (i got no internet at home)

Share this post


Link to post
Share on other sites
If you go to task manager and turn on the 'virtual memory size' column that will tell you when you've used up all the address space - the limit on that is about 2GB for a 32-bit OS. See http://blogs.technet.com/markrussinovich/ for details on how Windows handles memory.

As it falls over half way through my guess would be that you have a memory leak - you're not deleting something that you should be. VLD is useful for tracking any leaks down if you're using Visual Studio.

Share this post


Link to post
Share on other sites
It was no leak,
it was a bug in DevCpp..
With the same code, it sometimes compiled to some shit that used up 3mb a sec,
and sometimes it ran without an increasing memory load.
the only thing that is not right with the program at the moment is
that in the radiosity part, where the whole scene is rendered a thousands of times, memory load stays constant,
if the radiosity part is finished and normal rendering (with the same method) continues, memory load increases about 100k a second, and there's _nothing_ in the code that could cause that. strange

Share this post


Link to post
Share on other sites

This topic is 3291 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this