Jump to content
Sign In to follow this  
Cool_Z

Tutorial - Speculars without artefacts

5 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

Good day, Skyliners !!

Here is a little tutorial about speculars, more precisely about how to use less than 100% specular without getting artefacts.

 

Buildings with large glass surfaces are nice to look at, but the game engine has some limitations with the way speculars look.


If you want to use colored glass, the glass color will be faintly visible and only at certain angles (that's a bit how it works in reality too, but in the game it's much more noticable).
You can use bright colors (they are more visible) but you will get huge color leaks on the borders of the windows, and it is the reflections that will become almost non existent.


I made an oversimplified glass building using a colored diffuse map for the glass parts.

425512Capture01.jpg

Here it is ingame... you'll notice you almost can't see the diffuse color :(

762347Screenshot01.jpg

Then you might want to use a lower amount of reflection in the windows to let the colors show, here I've set it to 70%.
But... when you do it there seems to be a problem.

406576Screenshot02.jpg

Artefacts, artefacts everywhere ! (I could have used screenshots from some custom assets to show you this problem... but it wouldn't be very polite to do so).

The game engine seems to be trying to make a gradient between the pixels around and the zone where you use specular... and the results are nasty.

Here's one way to get rid of it, mapping the windows separately (here I mapped ONE window)...

521588Capture02.jpg471501Screenshot03.jpg

But... the artefacts are still there !!!

To avoid this, you must leave some space around the poly on your specular map, like this :

613095Capture03.jpg550341Screenshot04.jpg

It works, but it would be impossible for a big building to have ALL windows separate, the polycount would just skyrocket.

We could then use geometry (pylons, bars)  to separate the different windows, but then again, huge polycount (still for some buildings this could be ok).


There is an other solution for our particular problem; using alphas.

In your 3D program, duplicate the facade of your building (or the space where the windows will be)

170904Capture05.jpg

Map it in another place on the texture map, create the layout of the windows on this space as an alpha map. (You might notice I didn't use pure black for the windows cuts, refer to my tutorial about alphas for explanations about this).

310250Capture06.jpg

Map the specular with some marging around the zone on the map

578296Capture07.jpg


Now place this duplicate facade very close to the original one (I used a 5cm distance and I had no clipping in the game)

966424Capture08.jpg


The result ingame :

309999Screenshot05.jpg

No more artefacts at all, a smoooooooth surface.

Now compared to the 100 specular and the 70% specular :

405566Screenshot06.jpg


NOTE : this method has two problems.
First : it takes more texture space (although you can ruse by overlapping the mapping of the grid part, you'll lose a few polys but save huge space).
Second : the grid part will be a bit more aliased as a simple mapped texture. This is not very obvious but it's here (and it's thousands times better than crappy windows).


I hope you'll have fun experimenting with this... colored glass buildings rule :D

Questions ? Feedback ?? Shoot ! ;)


  Edited by Cool_Z  
  • Like 5

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

Very nice tutorial!

Does this also happen when you use a high-res texture for the window?

  • Like 1

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

Thank you for this info Zed!  I can finally figure out how to fix this building's terrible spec artifacts now!  :D

6E91E13E6E35B2A4F447DBEF60611C434D7871A2

  • Like 1

Share this post


Link to post
Share on other sites

Sign In or register to comment...

To comment in reply, you must be a community member

Sign In  

Already have an account? Sign in here.

Sign In Now

Create an Account  

Sign up to join our friendly community. It's easy!  

Register a New Account

Sign In to follow this  

×

Thank You for the Continued Support!

Simtropolis depends on donations to fund site maintenance costs.
Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

Make a Donation, Get a Gift!

Expand your city with the best from the Simtropolis Exchange.
Make a Donation and get one or all three discs today!

STEX Collections

By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

Each donation helps keep Simtropolis online, open and free!

Thank you for reading and enjoy the site!

More About STEX Collections