radiosity memory failure + artefacts

Started by
4 comments, last by psycoding 15 years, 4 months ago
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
Advertisement
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.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

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.
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)
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.
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

This topic is closed to new replies.

Advertisement