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

Author Topic: ALAGEngine - 2.5D Isometric Shading Engine  (Read 30989 times)

0 Members and 1 Guest are viewing this topic.

Gregouar

  • Sr. Member
  • ****
  • Posts: 462
  • www.holyspirit.fr : free hack'&'slash
    • MSN Messenger - Greg_le_sadique@hotmail.com
    • View Profile
    • www.holyspirit.fr
    • Email
Re: ALAGEngine - 2.5D Isometric Shading Engine
« Reply #15 on: March 06, 2018, 09:13:44 am »
Quote
Really nice. Can you render a blended wireframe on top, just out of curiosity?
What do you mean ? The meshes of the 3D models ? If yes, I don't have them for most of the assets because I kind of only recover their prerendered versions from my old projet and lost the original 3D models. But their were super high poly, so you would probably see pretty much nothing.  ;D

By the way, I implemented some basic parallax mapping, using raytracing for more accuracy. I plan to mainly use it for water rendering (and maybe dynamic modification of the relief ?).

Without parallax (we can some weird effect near the bottom tower for example):


With parallax:

Chaia*

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: ALAGEngine - 2.5D Isometric Shading Engine
« Reply #16 on: March 07, 2018, 03:19:58 pm »
Your project looks really nice!
However, at least for your final game you want to create with your engine you should work on the performance I think. I tried it on my laptop and the graphics are awesome but I get about 5 FPS only with the GPU being utilized at 30% and one of the CPU cores runs at max utilization.
i7 4700MQ + gt755m.

Technically I find your approach to handle sprites as "3D objects" inspiring :)

Gregouar

  • Sr. Member
  • ****
  • Posts: 462
  • www.holyspirit.fr : free hack'&'slash
    • MSN Messenger - Greg_le_sadique@hotmail.com
    • View Profile
    • www.holyspirit.fr
    • Email
Re: ALAGEngine - 2.5D Isometric Shading Engine
« Reply #17 on: March 07, 2018, 03:48:31 pm »
Quote
However, at least for your final game you want to create with your engine you should work on the performance I think. I tried it on my laptop and the graphics are awesome but I get about 5 FPS only with the GPU being utilized at 30% and one of the CPU cores runs at max utilization.
Sure, optimization is a big part of the job. However, you should already get better performances than that, I'm particularly surprised that the CPU is bottleneck. 

Since I was talking about it, I finally started working on water. Here are the first results, using Perlin noise:


EDIT: And after a bit of additionnal work:
« Last Edit: March 07, 2018, 06:36:54 pm by Gregouar »

Paul

  • Jr. Member
  • **
  • Posts: 78
    • View Profile
Re: ALAGEngine - 2.5D Isometric Shading Engine
« Reply #18 on: March 09, 2018, 11:40:42 am »
Is there big performance drop if you have more objects in scene?

Gregouar

  • Sr. Member
  • ****
  • Posts: 462
  • www.holyspirit.fr : free hack'&'slash
    • MSN Messenger - Greg_le_sadique@hotmail.com
    • View Profile
    • www.holyspirit.fr
    • Email
Re: ALAGEngine - 2.5D Isometric Shading Engine
« Reply #19 on: March 09, 2018, 12:59:31 pm »
Like I explained, you can choose if you want to puts objects as static or dynamics. Static objects have pretty much no impact on the performances since I just copy them in the buffer the first time they appear on screen. For dynamics objects, you just have the cost of drawing their 4 textures to the differents buffers.

Then all lighting is deferred, so it does not change anything for that part which stay "constant" (still depending on the amount of transparent fragments and reflectives one (I use a thresold on reflectivity for SSR). I probably should take some time to analyse my code and do some profiling to improves the performances though. So if any of you has any tips or suggestions, I'm listenning ; I'm still new to OpenGL and advanced graphics (e.g. I read somewhere that branching shaders are bad but it seems that nowadays GPU can handle without any trouble and I gain performances increase by branching out some fragments).

By the way, I fixed some issues with aliasing and SSAO:

Before and after:

« Last Edit: March 16, 2018, 12:54:54 pm by Gregouar »

Gregouar

  • Sr. Member
  • ****
  • Posts: 462
  • www.holyspirit.fr : free hack'&'slash
    • MSN Messenger - Greg_le_sadique@hotmail.com
    • View Profile
    • www.holyspirit.fr
    • Email
Re: ALAGEngine - 2.5D Isometric Shading Engine
« Reply #20 on: March 16, 2018, 01:14:56 am »
Hi guys ! Here are the latest news.

I mainly worked on my screen space foam rendering algorithm:





The idea is pretty simple, while I generate my heightmap, normalmap and so on I also generate a velocity map which encodes the speed and direction of my water fragments. Then during rendering I can use a simple raytracing algorithm to decide if the fragment will soon collides some opaque geometry. Then I modify the albedo and material of the fragment in function of the distance to the collision in order to generate foam. Since I generate my velocity map with the other maps, I have a  free Perlin noise that I can use to perturb my velocity vectors, to give it the random flavor that foam has.

I also changed my old sinus wave to a Gerstner wave. I generate it by taking N samples on [0,1], moving them along a circle (or ellipse) with angle depending on x. And then I just do a quadratic interpolation between my resulting points, so that I get a function y = f(x). It looks like that (linear interp here):

Quadratic interpolation allows me to compute very quickly the normal map.

Moreover, I added some antialiasing to interesction between 2.5D sprites (which was kind of ugly because of artefacts due to lack of precision in heightmaps). The idea is simple: I use the alpha pass to put some fragments that should be behind, on top, with opacity depending on the difference of depth. It is not very accurate, but the difference is subtle enough to really be a good tradeoff:

Top left: without AA, without SSAO ; Top right: without AA, with SSAO
Bottom left: with AA, without SSAO ; Bottom right: with AA, with SSAO

And that's it for today, stay tuned !
« Last Edit: March 16, 2018, 12:59:07 pm by Gregouar »

Chaia*

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: ALAGEngine - 2.5D Isometric Shading Engine
« Reply #21 on: April 06, 2018, 11:14:18 pm »
Would you mind to explain a little bit how you compute the shadow maps for directional lights without any "knowlege" about the geometry (as you basically seem to only render sprites eg. for the tree)?

Btw. the waves and foam of your current version look very nice!

Gregouar

  • Sr. Member
  • ****
  • Posts: 462
  • www.holyspirit.fr : free hack'&'slash
    • MSN Messenger - Greg_le_sadique@hotmail.com
    • View Profile
    • www.holyspirit.fr
    • Email
Re: ALAGEngine - 2.5D Isometric Shading Engine
« Reply #22 on: April 07, 2018, 11:55:15 am »
I basically use the heightmap to cast the shadow by considering texels as if they were voxels (so yes, I do not have shadow casted by backface ; I was planning on adding a depth/size value in the heightmap so that I can have better shadows for convex geometry but I don't know yet how to render such assets in Blender). And since I'm working with directionnal lights for these shadows, I only need to precompute the casted shadow when loading the scene and store it in a texture. Then I render them in the framebuffer of the light, using the heightvalue for the depthtest.

Also, here is my attempt at shallow waves rendering:

jamesk

  • Guest
Re: ALAGEngine - 2.5D Isometric Shading Engine
« Reply #23 on: April 15, 2018, 06:01:20 am »
This is nothing short of amazing. Where can I find a download link?

Gregouar

  • Sr. Member
  • ****
  • Posts: 462
  • www.holyspirit.fr : free hack'&'slash
    • MSN Messenger - Greg_le_sadique@hotmail.com
    • View Profile
    • www.holyspirit.fr
    • Email
Re: ALAGEngine - 2.5D Isometric Shading Engine
« Reply #24 on: April 16, 2018, 11:13:04 am »
This is nothing short of amazing. Where can I find a download link?

On the git repository: https://github.com/gregouar/ALAG

jamesk

  • Guest
Re: ALAGEngine - 2.5D Isometric Shading Engine
« Reply #25 on: April 17, 2018, 12:52:24 am »
The shader broke!

Failed to compile fragment shader:
WARNING: 0:1: '' :  #version directive missing
WARNING: 0:1: 'assign' : implicit type conversion allowed from GLSL 1.20
WARNING: 0:1: 'assign' : implicit type conversion allowed from GLSL 1.20
ERROR: 0:1: '=' :  cannot convert from 'const highp float' to '3-component vector of highp float'
ERROR: 0:1: 'assign' :  cannot convert from 'highp float' to '3-component vector of highp float'
ERROR: 0:1: '=' :  cannot convert from '3-component vector of highp float' to 'highp float'
WARNING: 0:1: 'assign' : implicit type conversion allowed from GLSL 1.20
WARNING: 0:1: 'assign' : implicit type conversion allowed from GLSL 1.20
WARNING: 0:1: 'assign' : implicit type conversion allowed from GLSL 1.20
WARNING: 0:1: 'texelFetch' : function is not available in current GLSL version
WARNING: 0:1: 'assign' : implicit type conversion allowed from GLSL 1.20


Failed to compile fragment shader:
WARNING: 0:1: '' :  #version directive missing
WARNING: 0:1: 'assign' : implicit type conversion allowed from GLSL 1.20
ERROR: 0:1: 'dot' : no matching overloaded function found (using implicit conversion)


Failed to compile vertex shader:
WARNING: 0:1: '' :  #version directive missing
ERROR: 0:1: 'assign' :  cannot convert from '4-component vector of highp float' to 'varying 2-component vector of highp float'

Was looking forward to playing it.

Gregouar

  • Sr. Member
  • ****
  • Posts: 462
  • www.holyspirit.fr : free hack'&'slash
    • MSN Messenger - Greg_le_sadique@hotmail.com
    • View Profile
    • www.holyspirit.fr
    • Email
Re: ALAGEngine - 2.5D Isometric Shading Engine
« Reply #26 on: April 17, 2018, 10:41:23 am »
My bad, a vec3 that should have been a float;  my gpu tends to ignore these kind of things. It should be fixed now.

Phanoo

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: ALAGEngine - 2.5D Isometric Shading Engine
« Reply #27 on: April 17, 2018, 05:51:50 pm »
Wow, it looks very nice !

The only thing that makes those water movements unrealistic is (in my opinion) the linear speed which seems to be applied to them. Having different speeds depending on the 'wave state' would make it less floaty (like a wave is slowly rising, then rapidly falling/splashing, with parts of it moving faster than the main water mass)
« Last Edit: April 17, 2018, 05:54:01 pm by Phanoo »

Gregouar

  • Sr. Member
  • ****
  • Posts: 462
  • www.holyspirit.fr : free hack'&'slash
    • MSN Messenger - Greg_le_sadique@hotmail.com
    • View Profile
    • www.holyspirit.fr
    • Email
Re: ALAGEngine - 2.5D Isometric Shading Engine
« Reply #28 on: April 17, 2018, 07:46:31 pm »
Yeah probably, I should also have more foam for the crashing and it should leave a trail behind. I should also have more randomness in the wave pattern.

jamesk

  • Guest
Re: ALAGEngine - 2.5D Isometric Shading Engine
« Reply #29 on: April 17, 2018, 09:19:45 pm »
Failed to compile fragment shader:
WARNING: 0:1: '' :  #version directive missing
WARNING: 0:1: 'assign' : implicit type conversion allowed from GLSL 1.20
WARNING: 0:1: 'assign' : implicit type conversion allowed from GLSL 1.20
ERROR: 0:1: '=' :  cannot convert from 'const highp float' to '3-component vector of highp float'
ERROR: 0:1: 'assign' :  cannot convert from 'highp float' to '3-component vector of highp float'
ERROR: 0:1: '=' :  cannot convert from '3-component vector of highp float' to 'highp float'
WARNING: 0:1: 'assign' : implicit type conversion allowed from GLSL 1.20
WARNING: 0:1: 'assign' : implicit type conversion allowed from GLSL 1.20
WARNING: 0:1: 'assign' : implicit type conversion allowed from GLSL 1.20
WARNING: 0:1: 'texelFetch' : function is not available in current GLSL version
WARNING: 0:1: 'assign' : implicit type conversion allowed from GLSL 1.20


Failed to compile fragment shader:
WARNING: 0:1: '' :  #version directive missing
WARNING: 0:1: 'assign' : implicit type conversion allowed from GLSL 1.20
ERROR: 0:1: 'dot' : no matching overloaded function found (using implicit conversion)


Failed to compile vertex shader:
WARNING: 0:1: '' :  #version directive missing
ERROR: 0:1: 'assign' :  cannot convert from '4-component vector of highp float' to 'varying 2-component vector of highp float'


Initializing application
Uniform "map_noise" not found in shader
Texture loaded from file: ../data/sarco-color.png
Texture loaded from file: ../data/sarco-normal.png
Texture loaded from file: ../data/sarco-heightmap.png
PBRTexture readed from file: ../data/sarcoXML.txt
PBRTexture readed from file: ../data/torusbXML.txt
Texture loaded from file: ../data/sand_color.png
Texture loaded from file: ../data/sand_depth.png
Texture loaded from file: ../data/sand_normal.png
Texture loaded from file: ../data/torusb.png
Texture loaded from file: ../data/panorama.jpg
Texture loaded from file: ../data/torusb_normal.png
Texture loaded from file: ../data/torusb_depth.png
PBR texture loaded from file: ../data/torusbXML.txt
Texture loaded from file: ../data/tree_albedo.png
Texture loaded from file: ../data/tree_normal.png
Texture loaded from file: ../data/tree_heightmap.png
Texture loaded from file: ../data/tree_material.png
PBRTexture readed from file: ../data/treeXML.txt
PBRTexture readed from file: ../data/abbayeXML.txt
ERROR: Cannot load PBR texture from file: ../data/cliffXML.txt
ERROR: Because: Failed to open file
PBRTexture readed from file: ../data/wetsand2XML.txt
PBRTexture readed from file: ../data/wetsandXML.txt
Font loaded from file: ../data/arial.ttf
Starting application
Failed to compile vertex shader:
WTARNING: 0:1: '' :  #version directive missing
ERROR: 0:1: 'assiexture loaded from file: ../data/abbaye_color.pngg
n'
:  cannot convert from '4-component vector of highp float' to 'varying 2-component vector of highp float'


Texture loaded from file: ../data/abbaye_normal.png
Texture loaded from file: ../data/abbaye_heightmap.png
PBR texture loaded from file: ../data/abbayeXML.txt
Texture loaded from file: ../data/wetsand2_albedo.png
Texture loaded from file: ../data/wetsand2_normal.png
Texture loaded from file: ../data/wetsand2_heightmap.png
PBR texture loaded from file: ../data/wetsand2XML.txt
Texture loaded from file: ../data/wetsand_albedo.png
Texture loaded from file: ../data/wetsand_normal.png
Texture loaded from file: ../data/wetsand_depth.png
Texture loaded from file: ../data/wetsand_material.png
PBR texture loaded from file: ../data/wetsandXML.txt

Still many shader errors at the moment. Can't see the final result.