SC4 Devotion Forum Archives

SimCity 4 Devotion Custom Content Showcase => NDEX Place => Inactive Teams => Team Custom Content Projects => NDEX Creations => Topic started by: RippleJet on November 23, 2007, 03:34:21 PM

Title: Key Tower and Triangle Tower by SuperStar Fixed
Post by: RippleJet on November 23, 2007, 03:34:21 PM
You all know about the rendering problem that has always been annoying with SuperStar's NDEX Key Tower, at zoom 3 in south and north directions.
Well, pictures say more than a thousand words...


Before
After
Night
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg235.imageshack.us%2Fimg235%2F9167%2Fkeytowerrenderingprobledk9.jpg&hash=3331109af3b7b67c6d06c489f6c32b6df4832ed6)
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg100.imageshack.us%2Fimg100%2F9463%2Fkeytowerrenderingfixednq3.jpg&hash=5e1599f9d5b5e49227f26e09297c376e410ec9ba)(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg100.imageshack.us%2Fimg100%2F5261%2Fkeytowerrenderingnightdi8.jpg&hash=cd71ebdd5ba4d3666ea02e48ccd33b846c314078)




And what did I do? ... well ...




1. I opened the model file in Reader.
The picture below shows the FSH (texture) file for the faulty view, and it looks OK:

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg100.imageshack.us%2Fimg100%2F1629%2Fkeytowerfshands3dfp6.jpg&hash=85ae7d9540f974ce21b99818a92991d485629092)

For now, just note that the FSH file is 2-dimensional with coordinates u and v,
that have the values (0,0) in the upper left hand corner and (1,1) in the lower right hand corner.




2. Then I opened the S3D file for the faulty view
...and we can see the well known problem:

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg510.imageshack.us%2Fimg510%2F5944%2Fkeytowerprobleminreaderke5.jpg&hash=2923d02a93a43bbe85578b56191e014f64ac8218)

Since the texture above looks OK, the problem had to be in the S3D file.
Clicking on the Vert tag above you get the mapping of the LOD vertices vs. the FSH texture.

There are 5 values for each vertice mapping; x, y, z, u and v.

x, y and z are the 3-dimensional coordinates (in metres) for the corners of the LOD box (the white wireframe).
The more complicated the LOD box is, the more corners it contains.
A simple, rectangular LOD box always has seven visible corners, four on top and three at the bottom.

u and v are the 2-dimensional coordinates (between 0 and 1) for the FSH file above.




3. I started to play around with the mapping values
...and pretty soon it was obvious that the u-values were far too low.

As you can see above the u-values for vertices 2 and 6 (the ones farthest to the right) are just 0.191406.
In other words, less than 20% of the FSH texture above is mapped inside the right edge of the LOD box.

Soon I figured out that the values were exactly 1/4 of what they should have been.
Thus, after multiplying each u-value by 4 we get the following result:

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg253.imageshack.us%2Fimg253%2F1892%2Fkeytowerfixedinreadermn7.jpg&hash=4d3d491f84b961374315d2bb9f197e9d1bcb548f)




Now, I would only want SuperStar to find this thread and give us permission to upload the fix on LEX! ::)
Title: Re: Key Tower by SuperStar Fixed
Post by: Godzillaman on November 23, 2007, 04:21:05 PM
PM him on ST. He's active you know. ;)
Title: Re: Key Tower by SuperStar Fixed
Post by: RippleJet on November 23, 2007, 04:36:21 PM
Quote from: Godzillaman on November 23, 2007, 04:21:05 PM
PM him on ST. He's active you know. ;)

I've sent him the message over PM, mail and MSN... I'm sure he will catch at least one of them! ::)
Title: Re: Key Tower by SuperStar Fixed
Post by: Andreas on November 24, 2007, 04:20:02 AM
That's great news! :) IIRC, Superstar tried to rerender the Key Tower a couple of times, but it always came out faulty. It's great to see that it was fixable rather easily - after hours and hours of research and trial & error, I suppose. ;)
Title: Re: Key Tower by SuperStar Fixed
Post by: Shadow_prophet on November 24, 2007, 12:41:59 PM
Thanks RippleJet for the step by step display. Now i finally got it fixed.  $%Grinno$%
Title: Re: Key Tower by SuperStar Fixed
Post by: RippleJet on November 24, 2007, 01:59:39 PM
Quote from: Shadow_prophet on November 24, 2007, 12:41:59 PM
Thanks RippleJet for the step by step display. Now i finally got it fixed.  $%Grinno$%

And for those who don't want to fix it themselves...
I got contacted by Superstar today he was delighted at having the fix uploaded on the LEX:

NDEX FIXED Key Tower by Superstar (http://sc4devotion.com/csxlex/lex_filedesc.php?lotGET=1340)

Thanks Superstar! :thumbsup:
Title: Triangle Tower by SuperStar Fixed
Post by: RippleJet on November 24, 2007, 05:10:55 PM
Now, I'm getting eager to find more of these... $%Grinno$%

Superstar's Triangle Tower had another error, a texture conflict:

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg218.imageshack.us%2Fimg218%2F5571%2Ftriangletowerrenderingelv1.jpg&hash=1886e0ad219bf705fa256b3c1904cc2449058601)

This required a renumbering of the ID's for 8 FSH textures (two zooms, four directions) that conflicted with in-game textures.
It wasn't really a big deal to fix them after all:

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg218.imageshack.us%2Fimg218%2F8555%2Ftriangletowerrenderingfqs6.jpg&hash=a78b6fe082eafcd05b9aaf750e8873ee08ffe396)

A fix for this is included in Superstar MEGA Props Vol02 (http://sc4devotion.com/csxlex/lex_filedesc.php?lotGET=756), which was updated earlier today! :thumbsup:
Title: Re: Key Tower and Triangle Tower by SuperStar Fixed
Post by: rickmastfan67 on November 24, 2007, 07:53:12 PM
Dang, you're on fire today RippleJet! :thumbsup: :thumbsup:
Title: Re: Key Tower and Triangle Tower by SuperStar Fixed
Post by: jeronij on November 24, 2007, 08:12:57 PM
So, now you discovered the fsh's and 3ds's  ::)  $%Grinno$% ¡¡¡

Excellent tricks and news about DA  :thumbsup: - thanks for sharing them here  ;)
Title: Re: Key Tower and Triangle Tower by SuperStar Fixed
Post by: beskhu3epnm on November 24, 2007, 10:22:19 PM
Is it just me, or is Tage like... a God or something.

I don't know, but every time I turn around, he's got something in the works that just... works!

Awesome work, I've updated that file... and will update any file you update, too.
Title: Re: Key Tower and Triangle Tower by SuperStar Fixed
Post by: Filasimo on November 24, 2007, 11:28:49 PM
i think we should make banners " In Tage we trust" and "Tage for President" and "Tage 3:16" just to name a few  :D
Title: Re: Key Tower and Triangle Tower by SuperStar Fixed
Post by: Shadow Assassin on December 01, 2007, 09:49:05 PM
Unfortunately, Ryan, I think Wou's already got dibs on the first one. :P

Nice, now I don't have to play around trying to get a decent shot now. :P
Title: Re: Key Tower and Triangle Tower by SuperStar Fixed
Post by: Cockatoo-210893 on April 24, 2008, 07:20:53 PM
I think I may have encountered the same problem with something I just rendered, although multiplying the U values by 4 didn't seem to help...
What do you make of this? (Note this model is actually meant to extend under ground level, it's a dock.)

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fi124.photobucket.com%2Falbums%2Fp11%2FParrotsSC4Photos%2FUV-problem.jpg&hash=07e618efb4acff45f3546c835491819106d640f2)

Here it is from the opposite angle, just for a reference on how it should be looking.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fi124.photobucket.com%2Falbums%2Fp11%2FParrotsSC4Photos%2FUV-no-problem.jpg&hash=c071c90059ff853b4792afbdccb8b8eacdeda1c5)

Can anyone help me out on this one? What values should I multiply by what to make it work?
Title: Re: Key Tower and Triangle Tower by SuperStar Fixed
Post by: RippleJet on April 25, 2008, 11:27:27 AM
Take a look at the v-values in the first view.
They should be between 0.00 and 1.00.

If you look at the second view, you can see that they are between 0.007874 and 0.952756.
In the first view they are between 0.007813 and 0.476563.

Based on that, I think you should double the v-values: :thumbsup:


From:
To:
    0.085938     0.171876
    0.3359380.671876
    0.2578130.515626
    0.0078130.015626
    0.2226560.445312
    0.4765630.953126
    0.3945310.789062
Title: Re: Key Tower and Triangle Tower by SuperStar Fixed
Post by: Cockatoo-210893 on April 25, 2008, 08:04:57 PM
Hey thanks for that, you were spot on, it worked.  :thumbsup:
You just saved me a lot of frustration!
Title: Re: Key Tower and Triangle Tower by SuperStar Fixed
Post by: Fatsuhono on August 03, 2008, 09:12:38 PM
Great work here guys!