Terrain Height Manipulation
-
- Hobgoblin
- Posts: 583
- Joined: Mon Aug 06, 2007 12:53 pm
- Location: Saarland, Germany
- x 50
Re: Terrain Height Manipulation
Yes normalmaps are broken. Could you share your solution? That would be great!
Best Regards
Lax
http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62
-
- Goblin
- Posts: 272
- Joined: Thu Jun 10, 2004 4:19 am
- x 26
Re: Terrain Height Manipulation
https://github.com/nicholaskomsa/ogre_t ... maps_fixed
Note that there is only a shader solution for hlsl
if you have any questions, let me know
could you post your code for the splatting in the other thread, please
-
- Hobgoblin
- Posts: 583
- Joined: Mon Aug 06, 2007 12:53 pm
- Location: Saarland, Germany
- x 50
Re: Terrain Height Manipulation
@dark_sylinc: Could you maybe port the hlsl implementation for normal map to glsl and metal?
I posted the code in the other thread.
Best Regards
Lax
http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62
-
- Hobgoblin
- Posts: 583
- Joined: Mon Aug 06, 2007 12:53 pm
- Location: Saarland, Germany
- x 50
Re: Terrain Height Manipulation
I integrated the solution of Nickak2003 for normal maps, and it works half way. It does crash sometimes and something really wrong with the lighting.
But the biggest issue is: Its a deeper modifaction in the terra source code and for the future it will become more and more complicated to maintain terra, as @dark_sylinc will integrate new features, fix bugs etc. and also the normal map solution does only work for hlsl shaders.
@dark_sylink: Would It be possible to integrate an official normal maps bug fix for terra? I think other users will need this too.
Best Regards
Lax
http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62
- TaaTT4
- OGRE Contributor
- Posts: 267
- Joined: Wed Apr 23, 2014 3:49 pm
- Location: Bologna, Italy
- x 75
- Contact:
Re: Terrain Height Manipulation
Senior programmer at 505 Games; former senior engine programmer at Sandbox Games
Worked on: Racecraft Esport — Racecraft Coin-Op, Victory: The Age of Racing
-
- Goblin
- Posts: 272
- Joined: Thu Jun 10, 2004 4:19 am
- x 26
Re: Terrain Height Manipulation
- TaaTT4
- OGRE Contributor
- Posts: 267
- Joined: Wed Apr 23, 2014 3:49 pm
- Location: Bologna, Italy
- x 75
- Contact:
Re: Terrain Height Manipulation
I'm sorry, but I didn't get your pointNickak2003 wrote: ↑Sat Jun 05, 2021 6:11 pm You're having crashes? I don't get crashes nor does the lighting seem wrong to me, how does it seem wrong?
OGRE vanilla was crashing when a detail normal map was used in Terra material. The crash was caused by syntax errors in the pixel shader code (that my PR has fixed in a way very similar to what you've done here: https://github.com/nicholaskomsa/ogre_t ... maps_fixed). There's no need to provide a tangent texture to the shader since they're mathematically calculated.
The screenshot I posted has been taken after having applied the PR and using a donut-style normal map.
Senior programmer at 505 Games; former senior engine programmer at Sandbox Games
Worked on: Racecraft Esport — Racecraft Coin-Op, Victory: The Age of Racing
-
- Goblin
- Posts: 272
- Joined: Thu Jun 10, 2004 4:19 am
- x 26
Re: Terrain Height Manipulation
The product I'm working hasn't been getting crashes for me nor others. I was asking if it's crashing for you and under what circumstance.TaaTT4 wrote: ↑Mon Jun 07, 2021 8:43 amI'm sorry, but I didn't get your pointNickak2003 wrote: ↑Sat Jun 05, 2021 6:11 pm You're having crashes? I don't get crashes nor does the lighting seem wrong to me, how does it seem wrong?
OGRE vanilla was crashing when a detail normal map was used in Terra material. The crash was caused by syntax errors in the pixel shader code (that my PR has fixed in a way very similar to what you've done here: https://github.com/nicholaskomsa/ogre_t ... maps_fixed). There's no need to provide a tangent texture to the shader since they're mathematically calculated.
The screenshot I posted has been taken after having applied the PR and using a donut-style normal map.
I have not looked at the new code yet, but in the original shader code- which recalling partially from memory- I did see that there was some sort of special transformation matrix stuff which math or technique I was unaware of or thought erroneous. I edited it and added the tangent map and it worked out. Could you tell me what this technique is called or what changes exactly were made or why?
-
- Goblin
- Posts: 272
- Joined: Thu Jun 10, 2004 4:19 am
- x 26
Re: Terrain Height Manipulation
- TaaTT4
- OGRE Contributor
- Posts: 267
- Joined: Wed Apr 23, 2014 3:49 pm
- Location: Bologna, Italy
- x 75
- Contact:
Re: Terrain Height Manipulation
The terrain system was crashing (due to a syntax error in the pixel shader) as soon as you try to set a detail normal map in one of the four slots.Nickak2003 wrote: ↑Sat Jun 19, 2021 1:59 am The product I'm working hasn't been getting crashes for me nor others. I was asking if it's crashing for you and under what circumstance.
I suppose you're referring to the TBN matrix. It serves to transform normal map values from tangent space to a different space such that they're aligned with the surface's normal direction. See here (especially the "Tangent space" paragraph) https://learnopengl.com/Advanced-Lighti ... al-Mapping for an in-deep explanation.Nickak2003 wrote: ↑Sat Jun 19, 2021 1:59 am I have not looked at the new code yet, but in the original shader code- which recalling partially from memory- I did see that there was some sort of special transformation matrix stuff which math or technique I was unaware of or thought erroneous. I edited it and added the tangent map and it worked out. Could you tell me what this technique is called or what changes exactly were made or why?
Senior programmer at 505 Games; former senior engine programmer at Sandbox Games
Worked on: Racecraft Esport — Racecraft Coin-Op, Victory: The Age of Racing