Jump to content


Radiosity lightmap generator (Delphi).


  • You cannot reply to this topic
2 replies to this topic

#1 Georgy

    New Member

  • Members
  • Pip
  • 7 posts

Posted 19 November 2005 - 12:17 PM

I've updated source code. Any ideas on how to make it faster and look better are welcome.

Here is screenshots (PNG format, 1:1):

Posted Image

Posted Image

source code (185kb)

#2 roel

    Senior Member

  • Members
  • PipPipPipPip
  • 697 posts

Posted 19 November 2005 - 01:05 PM

Can you maybe post a picture of the original scene, without radiosity, just to compare them? I think that things look a bit odd now, but I can't really say that without knowing what the original scene looks like. For example, the left side of the right cube looks way too red, assuming that the cube was originally white, but when it was originally red it could be okay, that makes it hard to judge.

#3 Georgy

    New Member

  • Members
  • Pip
  • 7 posts

Posted 19 November 2005 - 01:46 PM

although it is possible to write some code for correction
(make color values less aggressive).
It's easy. We have full control of incoming color values:

Quote

for I :=0 to RadW-1 do // Ïî âñåì òî÷êàì ïàìÿòè RadiosityPointer
for J :=0 to RadH-1 do
begin
Pixel:=Pointer(Integer(RadiosityPointer) + 3*(i*RadW + j));
R:=R+Pixel^.R * formFactor[i,j]; // ïðèìåíÿåì FormFactor
G:=G+Pixel^.G * formFactor[i,j]; // è óâåëè÷èâàåì êîìïîíåíòû R,G,B
B:=B+Pixel^.B * formFactor[i,j]; // íà çíà÷åíèÿ ÊÎÌÏÎÍÅÍÒÀ*ÔÎÐÌÔÀÊÒÎÐ
end;

result.R:=R/(RadW*RadH*255); // Ïåðåâîäèì â Single
result.G:=G/(RadW*RadH*255); // Çíå÷åíèÿ 0...255 â 0...1
result.B:=B/(RadW*RadH*255); // è óñðåäíÿåì äåëåíèåì íà RadW*RadH
So we can do absolutely everything with this incoming colors.
If some color value (R,G,B) is much bigger than another then change it.

Original scene:
Posted Image
only walls are colored





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users