Pages: 1 [2]
  Print  
Author Topic: Multitextured Terrain Example  (Read 5373 times)
Offline (Male) Goombert
Reply #15 Posted on: July 07, 2014, 04:01:00 AM

Contributor
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2988

View Profile
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
Logged
Welcome to ENIGMO, the game engine built by fucking aliens.

Offline (Unknown gender) egofree
Reply #16 Posted on: July 07, 2014, 04:27:49 AM
Contributor
Joined: Jun 2013
Posts: 604

View Profile Email
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
« Last Edit: July 07, 2014, 04:39:20 AM by egofree » Logged
Offline (Unknown gender) TheExDeus
Reply #17 Posted on: July 07, 2014, 06:31:28 AM

Developer
Joined: Apr 2008
Posts: 1886

View Profile
Quote
Looks 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.

Quote
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.
Can't wait to test it. It will probably increase FPS on my PC a lot too, because the terrain really benefits from mipmapping.
Logged
Offline (Unknown gender) egofree
Reply #18 Posted on: July 07, 2014, 07:23:49 AM
Contributor
Joined: Jun 2013
Posts: 604

View Profile Email
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 ?
« Last Edit: July 07, 2014, 08:17:01 AM by egofree » Logged
Offline (Unknown gender) TheExDeus
Reply #19 Posted on: July 07, 2014, 08:32:46 AM

Developer
Joined: Apr 2008
Posts: 1886

View Profile
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.
Logged
Offline (Male) Goombert
Reply #20 Posted on: July 08, 2014, 10:01:11 PM

Contributor
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2988

View Profile
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.
Logged
Welcome to ENIGMO, the game engine built by fucking aliens.

Offline (Unknown gender) TheExDeus
Reply #21 Posted on: July 09, 2014, 02:55:16 PM

Developer
Joined: Apr 2008
Posts: 1886

View Profile
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.
Logged
Offline (Male) Goombert
Reply #22 Posted on: July 09, 2014, 08:00:39 PM

Contributor
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2988

View Profile
Now that's looking fantastic, did you pull the mipmapping code from my commit? If so, did you enable anisotropic filtering as well?
Logged
Welcome to ENIGMO, the game engine built by fucking aliens.

Offline (Unknown gender) TheExDeus
Reply #23 Posted on: July 10, 2014, 09:16:52 AM

Developer
Joined: Apr 2008
Posts: 1886

View Profile
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.
Logged
Offline (Male) Josh @ Dreamland
Reply #24 Posted on: July 10, 2014, 09:24:00 PM

Prince of all Goldfish
Developer
Location: Ohio, United States
Joined: Feb 2008
Posts: 2933

View Profile Email
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.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Male) time-killer-games
Reply #25 Posted on: July 10, 2014, 09:46:36 PM

Member
Location: Virginia Beach
Joined: Jan 2013
Posts: 1061

View Profile WWW Email
@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).
« Last Edit: July 10, 2014, 09:55:53 PM by time-killer-games » Logged
Offline (Unknown gender) slojanko
Reply #26 Posted on: August 01, 2014, 03:21:36 AM
Member
Joined: May 2013
Posts: 7

View Profile
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:
« Last Edit: August 01, 2014, 03:25:11 AM by slojanko » Logged
Offline (Unknown gender) Solitudinal
Reply #27 Posted on: September 29, 2017, 04:04:37 PM
Member
Joined: Aug 2017
Posts: 16

View Profile
(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++).
Logged
Offline (Male) hpg678
Reply #28 Posted on: October 01, 2017, 06:17:57 AM

Member
Location: Barbados
Joined: Mar 2017
Posts: 105

View Profile Email
 :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)
Logged
Hugar
Offline (Male) time-killer-games
Reply #29 Posted on: October 01, 2017, 03:03:55 PM

Member
Location: Virginia Beach
Joined: Jan 2013
Posts: 1061

View Profile WWW Email
I don't think when Goombert implemented shaders that it was ever finished, iirc.
Logged
Pages: 1 [2]
  Print