Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Showcase / App Shader Kit (3D Shader Pack)

Author
Message
Rick Nasher
1
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 22nd Mar 2018 09:48
Thanks for the speedy action guys. AppGameKit support is top notch as far as I'm concerned.
Rick Nasher
1
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 22nd Mar 2018 09:49 Edited at: 22nd Mar 2018 09:50
[removed double post]
Santman
7
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 22nd Mar 2018 11:28
What can the landscape shader do? I've not bought this pack yet but will probably just for the screen space reflections....but the description of he landscape is quite small. Does this use paths too?
janbo
10
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 22nd Mar 2018 12:51 Edited at: 22nd Mar 2018 12:53
The Terrain shader uses 6 textures in total stage: 0 = base texture, 1 = texture for the Red channel of the splatmap, 2 = texture green channel, 3 = texture blue channel, 4 = alpha channel and stage 5 for the splatmap itself.
Thus enables you to draw 5 different textures textures on the terrain + bump-mapping which I could not capture all in one image
The Bump effect is made using the Height data encoded into the alpha channel of the 5 different textures (Red,Green,Blue,Height).

For this scene I just scaled up the normal using SP_Terrain_SetNormalSize() waited till night, placed a light and moved closer to the terrain

Attachments

Login to view attachments
Golelorn
2
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 22nd Mar 2018 23:07
Hey Janbo,

I tried to test out your terrain shader example, and got a precision error. Could this be due to my video card? I run on a nvidia 940MX. I'm not sure what to do, and I noticed no one else has reported this.

https://forum.thegamecreators.com/thread/221888 - I posted it in this thread.
hoyoyo80
2
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 22nd Mar 2018 23:19 Edited at: 22nd Mar 2018 23:26
I also get the error before, because i run the windows player with intel gpu, so i set it to nvidia and run fine.

Btw my laptop gpu is intel+1050ti.
Golelorn
2
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 23rd Mar 2018 00:06 Edited at: 23rd Mar 2018 00:16
Ah, OK. I made it always use the nvidia processor... I will be honest I have had this laptop for 1.5 years and have never bothered to look! LOL... Sadly, in my older years I rarely ever play video games. Thanks so much!

Its gorgeous Janbo!!
hoyoyo80
2
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 23rd Mar 2018 03:13 Edited at: 23rd Mar 2018 03:14
Try to set the windows agk2 player to run with nvidia, maybe itll work.

Attachments

Login to view attachments
janbo
10
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 23rd Mar 2018 12:34 Edited at: 23rd Mar 2018 12:35
Good you got it sorted out.
I develop using a Nvidia GTX 970 thats probably why there are occasionally things not working for Amd or other Graphics cards, through I test them every time with my mobile devices

Quote: "Its gorgeous Janbo!"

Thanks, I think 3D games are flourishing in AppGameKit now
Santman
7
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 23rd Mar 2018 13:27
Here's your next challenge Janbo......4a games and Nvidia got realtime ray tracing in the new metro.

https://youtu.be/ocg7Ai61ZPM
janbo
10
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 23rd Mar 2018 13:48
Thats a pretty nice demo, but you can create this kind of quality using deferred rendering and PBR in OpenGL, maybe even ES 2.0, too.
I guess I would need to use Microsofts DirectX Raytracing API for the realime part of the raytracing.
And this wouldn't work on mobiles at all
TomToad
1
Years of Service
User Offline
Joined: 6th Jan 2018
Location:
Posted: 28th Mar 2018 13:01 Edited at: 28th Mar 2018 13:02
Getting an error with the water shader. All the others work fine.

Attachments

Login to view attachments
Santman
7
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 28th Mar 2018 13:44
No, it's the lighting and perfect reflections that's the draw. If you check out the Nvidia website there's an awesome video showing all the tech features, it's simply beautiful.

But on reading it, I think it's a hardware update only in new cards about to launch anyway. Bummer.
Rick Nasher
1
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 28th Mar 2018 22:51 Edited at: 28th Mar 2018 22:53
@janbo

Didn't realize we could switch the interpreter to x64 (see thread here: https://forum.thegamecreators.com/thread/221939#msg2622209 )

This actually affects the performance positively(at least on my machine).
janbo
10
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 28th Mar 2018 23:02
@TomToad: Which Demo/other shaders are you running ?
@Rick Nasher: oh, new for me too, must try, thanks.
TomToad
1
Years of Service
User Offline
Joined: 6th Jan 2018
Location:
Posted: 29th Mar 2018 01:20
Ran all the demo with the shader pack. Everything works fine except the water shader and any that uses the water shader, such as the combined and terrain. I can get those to work if I remove all the calls to the water shader first.
janbo
10
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 29th Mar 2018 01:26
Never got this error. I can not make much sense of it. Try the raw shader code and remove the lines:


Do you have Slack ?
TomToad
1
Years of Service
User Offline
Joined: 6th Jan 2018
Location:
Posted: 29th Mar 2018 02:26
Removing those lines worked.
janbo
10
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 12th May 2018 19:03 Edited at: 12th May 2018 19:07
Working on foam for the water shader as requested several times.
I managed to make it working as I described here.
Right now its a working version of this Tutorial and I need to see how I implement something for you to switch things on and of like foam,lighting and maybe even reflection and refraction.
I think I can optimize it and get rid of the if condition etc.
If you can't wait for the next update I might upload an encrypted version of the water.ps file.

Attachments

Login to view attachments
Rick Nasher
1
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 12th May 2018 21:09
Certainly interesting janbo,if you can pull it off(hard to tell from stills).
BTW that sun shader shown in the other thread could also be used as a nice throw fireball effect for wizards or so.

janbo
10
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 23rd May 2018 18:19 Edited at: 23rd May 2018 18:19
Just a quick update to show I'm on it.
Gerstner Waves

Attachments

Login to view attachments
CodeName
2
Years of Service
User Offline
Joined: 30th Dec 2016
Location:
Posted: 23rd May 2018 22:31 Edited at: 23rd May 2018 22:32
@janboBy, any chance you can make a shader that makes a device display look like an old RGB tube display. Would be very handy for those making retro games look retro.

Nice waves by the way!
george++
11
Years of Service
User Offline
Joined: 13th May 2007
Location: Hellas
Posted: 24th May 2018 06:43
Hi janbo,
These are not waves, it is a storm!
Excellent work by the way.
Rick Nasher
1
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 24th May 2018 09:12
Those waves really look interesting. A video to show it in motion would be nice(I'm pretty curious).
janbo
10
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 26th May 2018 17:14 Edited at: 26th May 2018 17:18
Quote: "A video to show it in motion would be nice"

Just created the command set to setup the waves and foam.
You can alter the amplitude, length, direction, how many waves are layered over each other, the steepness and the speed of the waves.
The Waves are setup with a random parameters by Default.
Golelorn
2
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 28th May 2018 03:53
You are doing amazing things. Love this add on!
PSY
Valued Member
2
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 28th May 2018 10:09
Awesome work man!!


PSY LABS Games
Coders don't die, they just gosub without return
Rick Nasher
1
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 28th May 2018 23:45 Edited at: 28th May 2018 23:52
@janbo:
Good stuff Time to start surfin' those rollin' waves!

[EDIT]
Is there a way to detect when a wave is hitting an object, simulating a floating object, such as crate or ship? Perhaps a variable that provides the Y-height of the wave at X,Z location?
nonom
1
Years of Service
User Offline
Joined: 12th Nov 2017
Playing: AGK2
Posted: 30th May 2018 08:02
Impressive, really thanks @janbo for your support, I'm loving that foam and waves
http://www.nyan.cat/pirate
janbo
10
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 30th May 2018 12:21 Edited at: 21st Jun 2018 16:56
Quote: "Perhaps a variable that provides the Y-height of the wave at X,Z location"

Working on that right now besides trying to fix some bugs.
I thought I could just use the calculation from the vertex shader at first, but the vertices also need to move on the X and Z axis.
This is what I tried, but one can't just pull the Y value from it as it would be the height for another X and Z position:


[Edit]Now, I guess it's even better if you also get the X and Z distortion of a sample point.[Edit]
nonom
1
Years of Service
User Offline
Joined: 12th Nov 2017
Playing: AGK2
Posted: 1st Jun 2018 14:08 Edited at: 1st Jun 2018 14:09
Rick Nasher wrote: "Is there a way to detect when a wave is hitting an object, simulating a floating object, such as crate or ship? Perhaps a variable that provides the Y-height of the wave at X,Z location?"


It's possible imho with a simple buyoancy script, I had one, I'll try to port it.
http://www.nyan.cat/pirate
janbo
10
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 1st Jun 2018 17:43 Edited at: 1st Jun 2018 17:44
Quote: "It's possible imho with a simple buyoancy script, I had one, I'll try to port it."

I'm pretty sure you can't detect the distortion produced by a vertex shader, thats why I save the settings in arrays and try to reconstruct the calculation in AppGameKit, but even this turns out harder than I thought.
Cause the units are different or something, I somehow can't just take the same calculations from the GLSL code
Green7
13
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: Switzerland
Posted: 4th Jun 2018 10:32
What about detecting it with rays?
janbo
10
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 4th Jun 2018 18:24 Edited at: 4th Jun 2018 18:29
Yes, I was talking about ray casting, now I'm not sure what nonom was referring to
The vertex shader only changes the visual output, no actual mesh data you can check against.
Thats why I try to reconstruct the calculation, but I took the same calculation with the same parameters but get different results in AGK-code and GLSL.
Rick Nasher
1
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 9th Jun 2018 08:36
Quote: "Thats why I try to reconstruct the calculation, but I took the same calculation with the same parameters but get different results in AGK-code and GLSL. "


I might be completely off for do not have enough experience on the subject. but could it be a timing issue?
I can imagine something like the GLSL programming the GPU more directly in separate thread(s)?
janbo
10
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 10th Jun 2018 18:56
Quote: " but could it be a timing issue ?"

first of thanks for contributing some ideas
second the timing to animate the waves comes from AppGameKit itself
float agk_time = The time in seconds, taken from the AppGameKit Timer() command
Rick Nasher
1
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 14th Jun 2018 17:50
More than welcome of course.

But guess that's ruled out then, so no hope finding the cause/solution?

george++
11
Years of Service
User Offline
Joined: 13th May 2007
Location: Hellas
Posted: 20th Jun 2018 03:11
Hi janbo,
I think the pack should be released having #option_explicit directive of AppGameKit on
janbo
10
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 20th Jun 2018 22:17 Edited at: 20th Jun 2018 22:37
@Rick Nasher: There is hope, I just cant make sense for the values I had to type in AppGameKit to match the wave length,speed and amplitude of the shader
There must be some relation

@george++: You are right, I thought about that many times... it only forces you to declared the variables right ?
But the files will be much larger and I feel like loosing the "overview" kinda...
george++
11
Years of Service
User Offline
Joined: 13th May 2007
Location: Hellas
Posted: 20th Jun 2018 23:08 Edited at: 21st Jun 2018 11:08
Quote: "...and I feel like loosing the overview "kinda""

I have the same point of view. I am wondering if it is possible for the dev team to make this directive valid only for specific files. Also I don't know if the variable declaration makes the code slower. As far as I know in C++ you can declare varables, inside, for example, an "if" section, and this way the declaration is more efficient.
Santman
7
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 21st Jun 2018 12:38
Janbo, how do you pick up the intersect with the waves? I ask as I saw a fb post on someone who had done a landscape shader, and one of the things they did was create a fading overlap of the landscape texture where it intersected an object. So for example, a cliff or rocky outcrop blended perfectly into the landscape rather than have a cut off line around it.
janbo
10
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 21st Jun 2018 16:46 Edited at: 21st Jun 2018 16:57
@george++: I guess in AppGameKit it is more a safety for the programmer, as it is pretty much exact the same in performance, at least it's what my test say's


@Santman: As mentioned above, I calculate the waves again in AGK.
And I Guess the one on FB used two shader which work together and had to calculate the texture blend info in both, the shader for the rocks and for the terrain shader.
Shader only operate on the Graphics card and can't change anything on the Ram where the terrain mesh data would be.
Thats why you cant read something back i.e detect something, but its also a reason why they can be so fast

Above is how I try to calculate the Waves
Santman
7
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 21st Jun 2018 16:59
No,the Facebook one was very different I think, it appeared that the terrain moved up the object, only one way. It may have been two, but I can't even begin to imagine how they seamlessly detected the point at which the landscape texture should be replicated.....it was a complex pattern so tiled.

Maybe as it was in C they were able to do more than AGK. Dunno.
janbo
10
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 21st Jun 2018 17:17 Edited at: 21st Jun 2018 17:18
Quote: "Maybe as it was in C they were able to do more than AGK. Dunno."

OGL Shader are/do the same in every language

Can u send me a link...now I'm curious
Santman
7
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 21st Jun 2018 17:30
I mean, he may have been able to gain more control, for example as occlusion sharers do.

He also had projection mapping active, do textures tiled down larger faces - imagine one large vertice in a landscape, for me it stretches the texture. In his it scaled dynamically to the surface area but stayed seamless across the landscape.

Will find the link.
janbo
10
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 21st Jun 2018 18:03 Edited at: 21st Jun 2018 18:04
Normally you change the UV data for the terrain so it doesn't stretch, but for a terrain which is generated procedurally by a shader you use Tri planar mapping
I considered it for my terrain shader but decided to miss it out because, it would use three texture samples for each blendable texture times two for normalmapping (it's way to much). It also has to do with the texture restriction of 8 textures total.

The only thing occlusion shader should do different than others is that they write and read render targets of previous scenes.
Santman
7
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 21st Jun 2018 18:29
So I found it, and it's a unity based game but he did some epic stuff on the face of it....

Attachments

Login to view attachments
janbo
10
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 21st Jun 2018 18:37 Edited at: 21st Jun 2018 18:41
If it isn't helpful for the Waves its very interesting at least
This makes me wonder if you can render the two depth textures of the meshes separately, match the depth, decrease the distance and pass it as the actual depth buffer again (It should look strange, not like this at all)
Santman
7
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 21st Jun 2018 20:14
Tri planer mapping, that's the one. Might need to look into that.
Carharttguy
2
Years of Service
User Offline
Joined: 8th Jul 2016
Location: Belgium
Posted: 24th Jun 2018 14:15
Hello folks

I just downloaded the Shader pack, but I must be a total noob, where is the pack downloaded from Steam? Can't really find it on my computer.

Thanks

Login to post a reply

Server time is: 2019-01-22 18:02:22
Your offset time is: 2019-01-22 18:02:22