State of Fortune

Beauutiful!! Glad you did it!

I don’t think you quite understand bloom shaders :slight_smile:
What happens is the shader loops through the horizontal axis 5 times and the vertical axis 5 times and adds those samples together. This, indeed, is a blur. However the final bit (gl_FragColor = (final / 25) + color) adds the blur to the color of the pixel it is on, making any lighter pixels “bleed” into the current fragment. Maybe you are not setting the sampler2d correctly? I know it’s elementary but try just setting gl_FragColor to color. If the scene looks completely normal the color is being calculated correctly (I know you probably already did this).

Anyways, you should end up with something like this (this is a test scene for my playing around with shaders):

as I said this is a messy implementation and you can certainly improve on it but it will give you a taste for what it’ll look like.

It took an hour to add but it looks awesome and my fps didn’t even drop with 1. I’ll upload it into the game tomorrow or so.

With/without comparison look around the “shelf” over the doors, the shop letters, around the doors, the far away trees, the lowest window, the landscape and more:

http://stateoffortune.com/pictures/screenshots/ssao.png


http://stateoffortune.com/pictures/screenshots/nossao.png

Medal! :stuck_out_tongue:

Mike

Beauutiful!! Glad you did it!

I don’t think you quite understand bloom shaders :slight_smile:
What happens is the shader loops through the horizontal axis 5 times and the vertical axis 5 times and adds those samples together. This, indeed, is a blur. However the final bit (gl_FragColor = (final / 25) + color) adds the blur to the color of the pixel it is on, making any lighter pixels “bleed” into the current fragment. Maybe you are not setting the sampler2d correctly? I know it’s elementary but try just setting gl_FragColor to color. If the scene looks completely normal the color is being calculated correctly (I know you probably already did this).

Anyways, you should end up with something like this (this is a test scene for my playing around with shaders):

as I said this is a messy implementation and you can certainly improve on it but it will give you a taste for what it’ll look like.

I tried out a few different bloom effects but I didn’t really like it. It might look nice for a short while when walking outside from a dark area for example, but it’s not worth the performance hit of having it on all the time. I also found a nice artist and will try out if he can improve the textures and make better normal maps. :slight_smile:

I improved some things around the SSAO like allowing for anti aliasing (made it a little bit slower though), made it an option and uploaded it to the live game.

Here is the last screenshot for a while, thank you for pushing me! :slight_smile:

http://stateoffortune.com/pictures/screenshots/ssaoscaled.jpg

Just like every screenshot I posted you can click it for a bigger version. The grass used to look okay, but with the other improvements it is now the least good looking thing in the whole game :slight_smile:

Mike

I tried out a few different bloom effects but I didn’t really like it. It might look nice for a short while when walking outside from a dark area for example, but it’s not worth the performance hit of having it on all the time. I also found a nice artist and will try out if he can improve the textures and make better normal maps. :slight_smile:

I improved some things around the SSAO like allowing for anti aliasing (made it a little bit slower though), made it an option and uploaded it to the live game.

Here is the last screenshot for a while, thank you for pushing me! :slight_smile:

http://stateoffortune.com/pictures/screenshots/ssaoscaled.jpg

Just like every screenshot I posted you can click it for a bigger version. The grass used to look okay, but with the other improvements it is now the least good looking thing in the whole game :slight_smile:

Mike

I know I said that I’d not post another picture for a while, but my artist just delivered the first two new textures with normals and… well, see for yourself!


http://stateoffortune.com/pictures/screenshots/LQTexturesSmall.png


http://stateoffortune.com/pictures/screenshots/HQTexturesSmall.png

Click for full HD glory and switch inbetween a couple of times to see the improvement.

The new textures are 256x256 per block instead of 128x128 (which increases the download with 10mb, so I’ll make it an optional download). Safe to say though, I’ll always play with them on! I also cranked up the normal map contribution seeing as his normal maps are of much better quality than mine. :slight_smile:

Kind regards,
Mike

Two things I would like to add/ask.

Do you already use DXT compressed textures? They will cut down enormously on the file size.
Do you create the normal/alpha mip-maps correctly?
The thing with standard mip-maps for normal-maps is, that the lower mip levels will look flat. To have correct values you will need a base high-res bump-map(gray-scaled). You would than need to manually scale down this bump-map to each mip size and then convert each level to a normal-map.

Nope, I didn’t even know of that until now :slight_smile: Compressing the biggest texture brings it down from 6.5mb to 2mb. I’ll see if I can figure out how to read it in, that will make a nice size difference if the quality isn’t too bad!

Then… no, I’m not creating normal mip-maps correctly :slight_smile: What’s the reason of scaling the gray-scale map instead of scaling the normal map?

EDIT: Seeing as I’m using texture atlases (I guess that is why at least) the quality of the DXT1 compression didn’t get that good. It was worth a try though, thanks!

I know I said that I’d not post another picture for a while, but my artist just delivered the first two new textures with normals and… well, see for yourself!


http://stateoffortune.com/pictures/screenshots/LQTexturesSmall.png


http://stateoffortune.com/pictures/screenshots/HQTexturesSmall.png

Click for full HD glory and switch inbetween a couple of times to see the improvement.

The new textures are 256x256 per block instead of 128x128 (which increases the download with 10mb, so I’ll make it an optional download). Safe to say though, I’ll always play with them on! I also cranked up the normal map contribution seeing as his normal maps are of much better quality than mine. :slight_smile:

Kind regards,
Mike

Two things I would like to add/ask.

Do you already use DXT compressed textures? They will cut down enormously on the file size.
Do you create the normal/alpha mip-maps correctly?
The thing with standard mip-maps for normal-maps is, that the lower mip levels will look flat. To have correct values you will need a base high-res bump-map(gray-scaled). You would than need to manually scale down this bump-map to each mip size and then convert each level to a normal-map.

Nope, I didn’t even know of that until now :slight_smile: Compressing the biggest texture brings it down from 6.5mb to 2mb. I’ll see if I can figure out how to read it in, that will make a nice size difference if the quality isn’t too bad!

Then… no, I’m not creating normal mip-maps correctly :slight_smile: What’s the reason of scaling the gray-scale map instead of scaling the normal map?

EDIT: Seeing as I’m using texture atlases (I guess that is why at least) the quality of the DXT1 compression didn’t get that good. It was worth a try though, thanks!

You pass DXTn image data as is to your texture, instead of the RGBA pixel format, as your gpu natively supports DXTn.

You pass DXTn image data as is to your texture, instead of the RGBA pixel format, as your gpu natively supports DXTn.

Right, I decompressed it instead :slight_smile: I’ll try it out. Is it safe to say that gfx cards that support VBO’s also support DXTn?

Mike

Right, I decompressed it instead :slight_smile: I’ll try it out. Is it safe to say that gfx cards that support VBO’s also support DXTn?

Mike

My rusty TNT2 supported it. :point:

My rusty TNT2 supported it. :point:

To use DXT with a texture atlas I think you have to add a 1 pixel border to the single textures, but better do a bit of a search on that topic.
Here a blog post describing the problem with mipmaps of alphamaps:
http://the-witness.net/news/2010/09/computing-alpha-mipmaps/

The thing about normal maps is, that the represent vectors no colors. And when you do you normal bilinear scaling to create your mipmaps, you get wrong normal values. On the other hand there is no problem with scaling a bump-map, because it only holds scalar values.

To use DXT with a texture atlas I think you have to add a 1 pixel border to the single textures, but better do a bit of a search on that topic.
Here a blog post describing the problem with mipmaps of alphamaps:
http://the-witness.net/news/2010/09/computing-alpha-mipmaps/

The thing about normal maps is, that the represent vectors no colors. And when you do you normal bilinear scaling to create your mipmaps, you get wrong normal values. On the other hand there is no problem with scaling a bump-map, because it only holds scalar values.

I just finished uploading the higher quality textures. Thanks to the dds compression I’m now using 4 times as high resolution textures while using a quarter of the space :slight_smile: Thanks! Here is a picture of how the new blocks look like.


http://stateoffortune.com/pictures/screenshots/newBlocksSmall.png

Click for a bigger picture

There are still textures to be improved like the shop, shopkeeper, grain and the machines, but that will come at a later time.

Mike