Site Navigation
QuakeOne News
» Latest News
» News Archives
» QuakeOne Movies

QuakeOne Help
» File Downloads
» Quake Help
» Quake Servers

QuakeOne Community
» Forums
» Chat *new*
» Poll Booth
» Memberlist
» Member Map

Site Info
» Community Rules
» Moderator List

» Buy Quake

Visit On Facebook!Visit QuakeOne
on Facebook

Log in
User Name:


Not a member yet?
Register Now!
Online Users: 342
3 members and 339 guests
siger, TheKillingJoke
Most users ever online was 2,542, 06-04-2016 at 12:58 AM.
Go Back Home > Forum Search Forums

View Single Post
Unread 09-28-2016, 02:17 PM   #6 (permalink)
The man who sold the world
MadGypsy's Avatar
Posts: 5,057
+/-  Reputation: MadGypsy has a spectacular aura aboutMadGypsy has a spectacular aura aboutMadGypsy has a spectacular aura about
Join Date: Feb 2011
Currently: Offline

That's probably as good as I am going to get it. Obviously red represents dead space. I wish there was less dead space in some of those but, I just end up trading width red for more height red.

Original allocBlock system (from actual quake source) defined 1 static number that represented the height and width of the final atlas.

Math.sqrt( (total group width)*(maximum found height));

The original would throw an error if the best position + the current height blew out it's static number.

(best > 2048) throw Error(...)
which is also a static number but it is the absolute max that my platform can produce for image dimensions.

Also, I...

after every call to allocBlock
height = Math.max(lm.height + lm.y, height)

before I draw or even init the atlas
height = makePow2(height);

In essence:
I treat the lightmaps like one long singular row and square root the results.
That makes the width substantially less and allocBlock will position everything over many rows
I then let the height do whatever it wants all the way to my platform max.
I then find the highest used y value, make it power 2 and snip the rest.

Here is a code sample that illustrates everything I said. The left organizes and allocates everything before it is sent to the atlas. The right side is the allocation function itself.


I also changed the default for my fog to (0, 2000, 0x555555);
With such a large stretch between the origin and the max the gradient is much smoother. There are a lot of maps where this looks pretty good. Below is one.

I'm still going to make it to where these values can be overridden in worldspawn.

Last edited by MadGypsy; 09-28-2016 at 05:28 PM..
Reply With Quote

All times are GMT -6. The time now is 05:39 AM.

eXTReMe Tracker