Pages: 1 2
Author Topic: Multitextured Terrain Example  (90,921 Views)
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #15 Posted on: July 07, 2014, 09:01:00 AM
Hey ego, Direct3D9 can't run it because my shaders are GLSL. I never even added HLSL support for Direct3D9 yet. OpenGL3 can't run it because the shaders are incompatible. And Harri used a better random generation than I did, so yes mine appears blocky.

On an important side note, I am getting massive framerate increases, from 100 to 500, with mipmapping enabled. We need the sampler objects worked out for OGL3 however before it can be utilized in all graphics systems.
http://enigma-dev.org/forums/index.php?topic=2091
Offline (Unknown gender) egofree

Contributor
Joined: Jun 2013
Posts: 601
View profile
Reply #16 Posted on: July 07, 2014, 09:27:49 AM
By the way, it's a little bit off topic, but this type of graphics reminds me of the game 'Magic carpet' : http://en.wikipedia.org/wiki/Magic_Carpet_(video_game)

It's was an excellent game. If you don't know try to find it and test it ! But as it it's really old (1994), i guess it needs some dos emulator now. I don't think the default dos support on the current Windows is enough.

Edit:
It can be found on gog : http://www.gog.com/game/magic_carpet
Offline (Unknown gender) TheExDeus

Developer
Joined: Apr 2008
Posts: 1,860
View profile
Reply #17 Posted on: July 07, 2014, 11:31:28 AM
QuoteLooks nice Robert. I tested your example, and here is the result :
All of that is as expected. We should maybe show it via pop-up or something that GL1 shaders don't work on GL3, GL3 shaders don't work on GL1 and GL shaders in general don't work on DX. Otherwise people will start posting "bug reports" like ego here.

QuoteOn an important side note, I am getting massive framerate increases, from 100 to 500, with mipmapping enabled. We need the sampler objects worked out for OGL3 however before it can be utilized in all graphics systems.
Can't wait to test it. It will probably increase FPS on my PC a lot too, because the terrain really benefits from mipmapping.
Offline (Unknown gender) egofree

Contributor
Joined: Jun 2013
Posts: 601
View profile
Reply #18 Posted on: July 07, 2014, 12:23:49 PM
Quote from: TheExDeus on July 07, 2014, 11:31:28 AM
We should maybe show it via pop-up or something that GL1 shaders don't work on GL3, GL3 shaders don't work on GL1 and GL shaders in general don't work on DX. Otherwise people will start posting "bug reports" like ego here.

I don't know how shaders work, so perhaps what i will propose is nonsense, but for the functions which set the shaders, instead what about having two different functions for each shader version, or a parameter in the function which specify the shader version ?
Offline (Unknown gender) TheExDeus

Developer
Joined: Apr 2008
Posts: 1,860
View profile
Reply #19 Posted on: July 07, 2014, 01:32:46 PM
There are no different functions for different versions of shaders. It's not a runtime problem - you cannot use GL1 and GL3 shaders TOGETHER in one project. It's impossible, because the shader version depends on the version of GL you use (which is specified when creating the window context).

Differentiating between shader types is already in as a dropdown menu. It doesn't differentiate between GL1 and GL3 shaders though. My suggestion would be to add a special GLSL1.0 selection for GL1 shaders and then trow warnings/errors when using GL1 shaders in GL3 and GL3 shaders in GL1. So when you load a project and the user switches graphics systems, he would get a compile time warning (in LGM) that it uses wrong shaders. No need to do it at runtime.

The runtime shader compile error is actually already there, but I need to wrap it in "show_error". Right now it just prints to console that shader compilation has failed.
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #20 Posted on: July 09, 2014, 03:01:11 AM
Harri this is why LGM has the precompile option, you'll notice that option does not exist in Studio. So it is entirely up to us how we define its behavior, etc. in general one would assume that the precompile option builds and links your shader only when in the compliant graphics system.
Offline (Unknown gender) TheExDeus

Developer
Joined: Apr 2008
Posts: 1,860
View profile
Reply #21 Posted on: July 09, 2014, 07:55:16 PM
I enabled mipmapping and that really did boost the whole thing almost 200FPS. Then I also optimized the shader and halved the resolution of the reflection. It actually helps a bit too, because it blurs it a little and so the reflection is not so rough. I left refraction and absorbtion resolutions the same or else there are graphical glitches (that are fixable, but I don't want to do it now). Mipmapping makes the texture repeat a lot though. Without mipmapping it adds this noise which removes this noticeable repetition.


I will try to add trees next. I have problems with rotation calculations and UV coords for them.
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #22 Posted on: July 10, 2014, 01:00:39 AM
Now that's looking fantastic, did you pull the mipmapping code from my commit? If so, did you enable anisotropic filtering as well?
Offline (Unknown gender) TheExDeus

Developer
Joined: Apr 2008
Posts: 1,860
View profile
Reply #23 Posted on: July 10, 2014, 02:16:52 PM
No, I used the code already in ENIGMA. So no, anisotropic is still off, but there are functions for that in ENIGMA already too. I will try enabling it.
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #24 Posted on: July 11, 2014, 02:24:00 AM
Good lord. The sand is now beautiful, but that texture repetition is horrible. Can you write a custom sample function that computes perlin values per-point? Your grass looks like MS-paint spray art, and there's no reason not to just have it be procedural. :P

Forgive the harshish criticism; this could just be improved massively with one simple tweak.
Offline (Unknown gender) time-killer-games
Guest


Email
Reply #25 Posted on: July 11, 2014, 02:46:36 AM
@Josh it doesn't have to be photo-realistic to look good you know. I personally like the repeated texture it reminds me of Roller Coastrer Tycoon 2 (which was a 2d isometric game but with a similar atmosphere).
Offline (Unknown gender) slojanko

Member
Joined: May 2013
Posts: 7
View profile
Reply #26 Posted on: August 01, 2014, 08:21:36 AM
That looks amazing, reminds me of "From dust"

You could use larger textures to make it less visible that it repeats around an area.
Also, try making an SSAO shader:
Offline (Unknown gender) Solitudinal

Member
Joined: Aug 2017
Posts: 23
View profile
Reply #27 Posted on: September 29, 2017, 09:04:37 PM
(Dead topic, I know)

Does anyone still have a copy of this example or something similar to it? The dropbox link is giving me a 404.
As you may be aware, I'm trying to learn to use shaders in ENIGMA so I can incorporate animated models (which I currently have working fantastically in C++).
Offline (Unknown gender) hpg678

Member
Joined: Mar 2017
Posts: 283
View profile
Reply #28 Posted on: October 01, 2017, 11:17:57 AM
 :ohdear: I've also been trying to use Shaders in my projects,  without much success. I've also been looking for this file also but no success either. It's been a disappointing week :ohdear: :ohdear: ......but I'm not willing to give up just yet.

I'm gonna take a couple of days off, then start up again so I should have more success then.  (Y)
Offline (Unknown gender) time-killer-games
Guest


Email
Reply #29 Posted on: October 01, 2017, 08:03:55 PM
I don't think when Goombert implemented shaders that it was ever finished, iirc.
Pages: 1 2