Re: Question about dealing with content creation for large worlds

Jon Watte <[email protected]> Sun, 2 Dec 2012 00:01:42 -0800
Newsgroups gmane.games.devel.sweng
Message-ID <CAJgyHGOJE5TvJ8WiujARkhmMOyc8BP+REzgzSCxiBzvvuNAujA@mail.gmail.com>
--===============0678836582==
Content-Type: multipart/alternative; boundary=e89a8ff1c4be1c624b04cfda0b90

--e89a8ff1c4be1c624b04cfda0b90
Content-Type: text/plain; charset=UTF-8

Tools like Google Earth (and the military type tools that come after the
Keyhole system that spawned GE) do something like that. It's not terribly
hard to implement, BUT it will not be as good as hand-generated UV mapping.
This is the general trade-off between large-scale automation, used for
commercial systems, and hand-tuned game art, used to squeeze the last pixel
out of limited consumer hardware.

There are a number of unwrapping algorithms that have various drawbacks.
You pick one that has draw-backs you can live with :-) The keywords to look
for in research are "mesh parameterization."
Or you can look at the unwrap tools available in 3ds Max et al. One that
works alright is: 1. Pick the biggest unused triangle. This triangle makes
a reference plane. Mark it "used."
2. Pick all unused neighbors that deviate from this triangle by less than X
degrees (dot normal test) and project/map those to the reference plane.
Mark those as "used."
3. Keep doing this, excluding triangles that would overlap the already
mapped triangles.
4. When you cannot find more neighbors that match the criteria, you have a
"cluster." Repeat from 1 until there are no more unused triangles.

Another is even simpler:
1. Pick the biggest unused triangle. Mark it used.
2. Map it to an unused area of a texture.
3. Goto 1 if there are still unused triangles.

You will have to duplicate texels across the split borders in the generated
textures.

Another place to look is probably in various light map generation tools, as
they also solve a similar problem.

As for the "find cohesive sets of triangles to treat as a single thing,"
again, light mapping tools solve a problem similar to that. The "walk,
collecting triangles that don't deviate too much in normal" is also useful,
although you'll want to also include pieces that are "small" compared to
the full triangle surface set, so that you treat a full facade with
overhangs and dormers and shutters and windowsills as a single "thing."
"thickening" the selected triangles into a volume of X meters surrounding,
and including everything "small" in that volume, also is a reasonable
heuristic.

Again, let me repeat: This will *not* be as good as hand-generated UVs, and
thus your game won't look as good as the best hand-tuned AAA game with 200
artists on it. But perhaps that's not the goal.


Sincerely,

Jon Watte


--
"I pledge allegiance to the flag of the United States of America, and to
the republic for which it stands, one nation indivisible, with liberty and
justice for all."
~ Adopted by U.S. Congress, June 22, 1942



On Fri, Nov 30, 2012 at 8:47 AM, Juan Linietsky <[email protected]> wrote:

> oops sent the mail accidentally. Continued.
>
> for 2), is there any algorithm recommended for doing the world subdivision
> and automatic UV generation (unwrapping?), I suppose it needs to consider
> that
>       a) it should generate more textures if there is a larger plolyhedral
> surface to cover in that zone
>       b) can generate UV coordinates by brute force that are somewhat
> acceptable overall or, in the worst case, with the help of the artist
> specifying seams
>
> for 3) being more of a production question,  which app is best to paint
> over the resulting models that are more architectural than organic?
>
> Thanks!
>
> Juan Linietsky
>
>
> _______________________________________________
> Sweng-Gamedev mailing list
> [email protected]
> http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com
>
>

--e89a8ff1c4be1c624b04cfda0b90
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Tools like Google Earth (and the military type tools that come after the Ke=
yhole system that spawned GE) do something like that. It&#39;s not terribly=
 hard to implement, BUT it will not be as good as hand-generated UV mapping=
. This is the general trade-off between large-scale automation, used for co=
mmercial systems, and hand-tuned game art, used to squeeze the last pixel o=
ut of limited consumer hardware.<div>
<br></div><div>There are a number of unwrapping algorithms that have variou=
s drawbacks. You pick one that has draw-backs you can live with :-) The key=
words to look for in research are &quot;mesh parameterization.&quot;</div>
<div>Or you can look at the unwrap tools available in 3ds Max et al. One th=
at works alright is: 1. Pick the biggest unused triangle. This triangle mak=
es a reference plane. Mark it &quot;used.&quot;</div><div>2. Pick all unuse=
d neighbors that deviate from this triangle by less than X degrees (dot nor=
mal test) and project/map those to the reference plane. Mark those as &quot=
;used.&quot;</div>
<div>3. Keep doing this, excluding triangles that would overlap the already=
 mapped triangles.</div><div>4. When you cannot find more neighbors that ma=
tch the criteria, you have a &quot;cluster.&quot; Repeat from 1 until there=
 are no more unused triangles.</div>
<div><div><br></div><div>Another is even simpler:</div><div>1. Pick the big=
gest unused triangle. Mark it used.</div><div>2. Map it to an unused area o=
f a texture.</div><div>3. Goto 1 if there are still unused triangles.<br>
<br>You will have to duplicate texels across the split borders in the gener=
ated textures.</div><div><br>Another place to look is probably in various l=
ight map generation tools, as they also solve a similar problem.</div><div>
<br></div><div>As for the &quot;find cohesive sets of triangles to treat as=
 a single thing,&quot; again, light mapping tools solve a problem similar t=
o that. The &quot;walk, collecting triangles that don&#39;t deviate too muc=
h in normal&quot; is also useful, although you&#39;ll want to also include =
pieces that are &quot;small&quot; compared to the full triangle surface set=
, so that you treat a full facade with overhangs and dormers and shutters a=
nd windowsills as a single &quot;thing.&quot; &quot;thickening&quot; the se=
lected triangles into a volume of X meters surrounding, and including every=
thing &quot;small&quot; in that volume, also is a reasonable heuristic.</di=
v>
<div><br></div><div>Again, let me repeat: This will *not* be as good as han=
d-generated UVs, and thus your game won&#39;t look as good as the best hand=
-tuned AAA game with 200 artists on it. But perhaps that&#39;s not the goal=
.<br>
<br><br>Sincerely,<br><br>Jon Watte<br><br><br>--<br>&quot;I pledge allegia=
nce to the flag of the United States of America, and to the republic for wh=
ich it stands, one nation indivisible, with liberty and justice for all.&qu=
ot;<br>
~ Adopted by U.S. Congress, June 22, 1942<br><br>
<br><br><div class=3D"gmail_quote">On Fri, Nov 30, 2012 at 8:47 AM, Juan Li=
nietsky <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=
=3D"_blank">[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D=
"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding=
-left:1ex">
oops sent the mail accidentally. Continued.<div><br></div><div><div class=
=3D"im"><div>for 2), is there any algorithm recommended for doing the world=
 subdivision and automatic UV generation (unwrapping?), I suppose it needs =
to consider that</div>

<div>=C2=A0 =C2=A0 =C2=A0 a) it should generate more textures if there is a=
 larger plolyhedral surface to cover in that zone</div></div><div>=C2=A0 =
=C2=A0 =C2=A0 b) can generate UV coordinates by brute force that are somewh=
at acceptable overall or, in the worst case, with the help of the artist sp=
ecifying seams</div>

<div><br></div><div>for 3) being more of a production question, =C2=A0which=
 app is best to paint over the resulting models that are more architectural=
 than organic?</div><div><br></div><div>Thanks!</div><span class=3D"HOEnZb"=
><font color=3D"#888888"><div>
<br></div><div>Juan Linietsky</div>
<div><br></div></font></span></div>
<br>_______________________________________________<br>
Sweng-Gamedev mailing list<br>
<a href=3D"mailto:[email protected]">Sweng-Gamedev@list=
s.midnightryder.com</a><br>
<a href=3D"http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnig=
htryder.com" target=3D"_blank">http://lists.midnightryder.com/listinfo.cgi/=
sweng-gamedev-midnightryder.com</a><br>
<br></blockquote></div><br></div></div>

--e89a8ff1c4be1c624b04cfda0b90--

--===============0678836582==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Sweng-Gamedev mailing list
[email protected]
http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com

--===============0678836582==--