Author Topic: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC  (Read 6061 times)

0 Members and 1 Guest are viewing this topic.

Offline dino

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #60 on: February 15, 2023, 01:05:38 AM »
Blurring the shadowing would probably fall under low effort.

But we hear you, it's just that you show us the map rendering, so we are commenting on the map rendering, nothing more to it, prioritize as you see fit.


Offline DrazharLn

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #61 on: February 15, 2023, 01:23:45 AM »
Sorry if I came across as nagging or demanding, I was having some fun trying to understand what I liked about SMAC's map appearance and maybe derailed things a bit!

Offline afwbkbc

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #62 on: February 15, 2023, 02:46:44 AM »
All good :)
Made some changes to lighting, maybe it looks a bit better, not sure.

Blurring shadows may be easy, yes, I'll research it tomorrow.
« Last Edit: February 15, 2023, 03:14:03 AM by afwbkbc »

Offline afwbkbc

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #63 on: February 15, 2023, 12:59:02 PM »
I'll leave lighting like this for now.
I didn't find simple way to blur shadows, they are generated in shaders from interaction between lights and terrain geometry, each tile consists from just 5 vertexes ( center, left, top, right, bottom ) so can't be smoothed much physically. Adding more vertexes would be terrible for fps, so it's a no. Usually other techniques are used to smooth edges in 3D games (without actually modifying geometry), if somebody knows exact formula you can try modifying shaders here - https://github.com/afwbkbc/glsmac/blob/main/src/graphics/opengl/shader_program/Orthographic.cpp
Once terrain edges are smoothed - shadows from them will smooth too and that's the right way.

Offline dino

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #64 on: February 15, 2023, 01:24:30 PM »
Sure, it looks good enough already, move on if you want to.

I'll just add, that I've made a mistake, I've meant lightmap, not shadowmap. Prebaked lighting is faster than realtime and it possibly could be done in a way were you could get a single lightmap texture for the entire map geometry, then a blur filter could be applied to it, to smooth the shading and I imagine the result could look at least simillar to the original, if not outright being the same. I'm not a programmer, or 3D graphic artist, so I may be wrong, I'm just throwing an idea to consider somewhere down the line.
« Last Edit: February 15, 2023, 01:41:40 PM by dino »

Offline afwbkbc

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #65 on: February 15, 2023, 01:58:13 PM »
> Prebaked lighting is faster than realtime
Yes, at some day I'll do that. My approach is to not apply any optimizations until they are needed, I determine that by checking FPS, for now it's around 3000-4000 FPS on fullscreen map which seems good enough  ;lol
For example, UI was rendered in realtime at first, then I noticed that it started lowering FPS a lot (depending on number of UI elements) so I made framebuffer and redraw only when something changes. Same will be done about lighting - as soon as I notice FPS drop I'll start doing optimizations.
Yes, with prebaked lighting it should be easier to blur too (in theory), good point. I'd like to put some sprite and voxel units on map first (and maybe cities), at least to be able to test it, for example if I do all lighting stuff now later it may turn out it's not compatible and needs to be reworked. Better to focus on lighting when everything else is already there.

Offline afwbkbc

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #66 on: February 17, 2023, 02:02:25 AM »
Ok, I managed to blur it now  8) And water looks smoother too. Ok, moving to coastlines for real  :)

Online Buster's Uncle

  • In Buster's Orbit, I
  • Ascend
  • *
  • Posts: 49272
  • €442
  • View Inventory
  • Send /Gift
  • Because there are times when people just need a cute puppy  Soft kitty, warm kitty, little ball of fur  A WONDERFUL concept, Unity - & a 1-way trip that cost 400 trillion & 40 yrs.  
  • AC2 is my instrument, my heart, as I play my song.
  • Planet tales writer Smilie Artist Custom Faction Modder AC2 Wiki contributor Downloads Contributor
    • View Profile
    • My Custom Factions
    • Awards
Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #67 on: February 17, 2023, 02:18:06 AM »
That almost-plaid pattern in the fugus is going to need some jiggering, of course.

Offline DrazharLn

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #68 on: February 17, 2023, 02:58:26 AM »
That looks pretty good!

Offline afwbkbc

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #69 on: February 17, 2023, 12:02:23 PM »
Improved fungus pattern a bit. Lines can still be seen but that's hard to eliminate completely (without cutting big part of texture off and stretching other one which loses quality too much)

Offline afwbkbc

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #70 on: February 18, 2023, 12:52:32 AM »
Worked on coastlines a bit (not final version yet)

Offline DrazharLn

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #71 on: February 18, 2023, 03:12:46 AM »
Nice start!

Offline dino

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #72 on: February 19, 2023, 03:42:02 PM »
Blur on shadows and water looks great, but I'd try to maybe make it a bit less intense for both, I feel like smaller bumps on terrain almost loose shadowing, I'd also make the coastline a bit less rugged, but if you disagree with any of these suggestions, then it's perfectly satisfactory to me as it is.

I'd like a graphic option, rather disabled by default, to use a simple nearest neighbour interpolation instead of texture filtering, for the original sharp grainy look. It may be a preference not shared by most, but I think these low res textures in old games are designed in a way that every pixel counts and hints at something, so these textures feel to me somehow less detailed and defined after filtering.




« Last Edit: February 19, 2023, 04:04:03 PM by Buster's Uncle »

Offline afwbkbc

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #73 on: February 19, 2023, 07:04:37 PM »
> but I'd try to maybe make it a bit less intense for both
Shadows are just consequence of terrain sharpness, if you compare land elevations then they look a lot more flat in SMAC. Also in SMAC water is generally less deep, except for few places. Current mapgen in GLSMAC is just quickly thrown together to test things, it's possible that mapgens won't generate that much mountains so problem won't be seen. Mapgens will play big role in how world is seen.
Other difference is that SMAC uses 55-60 degrees 'camera angle', in GLSMAC it's currently 45, but I'll change to SMAC-like if SMAC sprites won't look good at 45.
So many things will change with rendering still.

> I feel like smaller bumps on terrain almost loose shadowing
There will be bumpmapping later which will solve it

> I'd also make the coastline a bit less rugged
Yes I'm still playing with numbers trying to find optimal ratio.

> for the original sharp grainy look
There will be 'sharpening' post-processing filters later, amongst others (maybe even 256-color filter just in case). And there will be many settings once settings UI is done  :)

> but if you disagree with any of these suggestions
Actually I agree, it's just a matter of priorities :) For now I won't focus on graphics too much, need gameplay first. Coastlines are last time-consuming visual thing before I move to sprite and CVR units.
And yes, as I said - SMAC was in development 3-4 years so they had time to align every pixel perfectly :) I need to find balance to be able to make it playable within reasonable time.
There's also possibility of somebody joining project later and working on improving graphics here and there while I continue with main things.

And I think I almost finished with coastlines for now (just maybe need to draw small border at edge, but maybe it's already good as it is).

Online Buster's Uncle

  • In Buster's Orbit, I
  • Ascend
  • *
  • Posts: 49272
  • €442
  • View Inventory
  • Send /Gift
  • Because there are times when people just need a cute puppy  Soft kitty, warm kitty, little ball of fur  A WONDERFUL concept, Unity - & a 1-way trip that cost 400 trillion & 40 yrs.  
  • AC2 is my instrument, my heart, as I play my song.
  • Planet tales writer Smilie Artist Custom Faction Modder AC2 Wiki contributor Downloads Contributor
    • View Profile
    • My Custom Factions
    • Awards
Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #74 on: February 19, 2023, 07:14:48 PM »
It sure ain't bad at all, as-is.

 

* User

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

* Community poll

SMAC v.4 SMAX v.2 (or previous versions)
-=-
24 (7%)
XP Compatibility patch
-=-
9 (2%)
Gog version for Windows
-=-
103 (32%)
Scient (unofficial) patch
-=-
40 (12%)
Kyrub's latest patch
-=-
14 (4%)
Yitzi's latest patch
-=-
89 (28%)
AC for Mac
-=-
3 (0%)
AC for Linux
-=-
6 (1%)
Gog version for Mac
-=-
10 (3%)
No patch
-=-
16 (5%)
Total Members Voted: 314
AC2 Wiki Logo
-click pic for wik-

* Random quote

I hold a scrap of paper in the darkness and light it. I watch it burn bright and curl, disappearing into nothingness, and the heat burns my fingers. Where has it gone? What has it become? I cannot shake the feeling that I have witnessed a form of transcendence.
~Commissioner Pravin Lal 'The Convergence'

* Select your theme

*
Templates: 5: index (default), PortaMx/Mainindex (default), PortaMx/Frames (default), Display (default), GenericControls (default).
Sub templates: 8: init, html_above, body_above, portamx_above, main, portamx_below, body_below, html_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 45 - 1228KB. (show)
Queries used: 38.

[Show Queries]