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/AppGameKit Studio Showcase / App Shader Kit (3D Shader Pack)

Author
Message
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 31st Aug 2018 15:12
Not sure what you mean.
What is your "layer mask" and how can it be based on a greyscale image
Quote: "But loading in via the shader still creates just a flat color"

What have you done before ?

Maybe try to get the base texture working first:
So you add your desired texture as the first texture parameter and fill the others with something else.
And a completely transparent splat-map as the last parameter.
The result should be the base texture only.
Then add a second texture id as parameter and alter the splat-map accordingly:
Just draw with red=255,Green=0,Blue=0,Alpha=0 to into the splat-map.
Now you should get two textures.

If that doesn't work something else is wrong here.
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 31st Aug 2018 15:44 Edited at: 31st Aug 2018 15:47
I am referring to the textures. I can only get the ones you provided in the example to work. I am attempting to learn how to make them in the same manner.


I don't have any problems with the splat map, and I understand how it works.

Sorry for the confusion.
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 31st Aug 2018 15:59
Oh, wow.... I am a complete idiot. I forgot to SetImageWrap on my textures... Sorry....
basicFanatic
6
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 1st Sep 2018 13:36
Hi janbo, would be super nice if this could work along with Rons VR extension. But no hurry. Right now I'm scavenging the 'Useful Community Shaders Project' thread for VR friendly shaders. Lots of broken stuff, but hidden treasures too.
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 6th Sep 2018 17:14
Hi @janbo. Are you planning release the water update?. Thanks

janbo wrote: "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."


http://www.nyan.cat/pirate
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 7th Sep 2018 14:44 Edited at: 7th Sep 2018 14:46
Quote: "Are you planning release the water update?"

Of course, but I'm not sure how to time it, I wait for TGC to let me know when it's time, until then I consider/play with other effects.
For example I want to implement a full screen edge detection(like outlines but with a threshold to detect edges)
I know it has been a long time since the last update

Edge Detection: (Ignore the values)

Attachments

Login to view attachments
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 7th Sep 2018 16:45
Thanks mate and keep up the good work!
http://www.nyan.cat/pirate
Icerion
5
Years of Service
User Offline
Joined: 3rd Aug 2018
Location:
Posted: 7th Sep 2018 17:18
@janbo : Are you able to release the Ocean / Sea foam shaders?

Thanks!
Arbrakan
13
Years of Service
User Offline
Joined: 10th Oct 2010
Location: Geneva
Posted: 17th Oct 2018 22:25
Hey thanks for the new update Janbo !!

Do you have a Patreon.com account ?
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 18th Oct 2018 04:04
Janbo,

Does the depth texture work on android?

Per AppGameKit help file:

"Note that some devices (particularly Android) do not support rendering depth to an image, in these cases the only valid values for the depth ID are 0 and -1."

Am I misinterpreting this?
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 18th Oct 2018 12:01
I'm back from hiking.

@Arbrakan: Hey, no I have not, and never thought about that as I already charge money for the pack itself,
so don't give me something for that, but what you CAN do, is talking about the shaders, and especially finish your awesome game

@Golelorn: Yes my shader work on android too, till now I'm the only one who made depth maps for mobile possible via a separate shader which encodes the depth in the RGBA channels
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 18th Oct 2018 22:34
Gotcha, thanks Janbo.
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 21st Oct 2018 22:02
Any news about the water upgrade?
surfing dry land
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 22nd Oct 2018 19:00 Edited at: 22nd Oct 2018 19:03
I see...
there is no separate Ocean Demo for the Ocean shader... It is demonstrated in the Collection Demo though.
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 6th Nov 2018 17:39 Edited at: 6th Nov 2018 17:40
janbo wrote: "there is no separate Ocean Demo for the Ocean shader... It is demonstrated in the Collection Demo though."


It's just what I was looking for. Thanks janbo!!
surfing dry land
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 7th Nov 2018 16:16 Edited at: 7th Nov 2018 16:21
Should the Shader Pack appear in the IDE DLC menu? I have the shader pack in my steam library, but it's not appearing in the IDE (I'm sure it was there before).

EDIT: Fixed it! I un-ticked the shader pack in steam, then re-ticked it and it's back.

Attachments

Login to view attachments
george++
AGK Tool Maker
16
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 31st Dec 2018 19:44 Edited at: 31st Dec 2018 19:49
Hi,
I have a difficulty using the shader pack.
I have the following folder structure for my projects:
Quote: "
c:\AGK Projects\project1
c:\AGK Projects\project2
"


and so on..

I've copied the Templates folder from the shader pack to the following location:
Quote: "
c:\AGK Projects\Templates
"


I included statement into my main.agc as follows:

The application runs by pressing the F8 key but not if I press the F5 key. I get the following error:


The same error applies when I try to run the app in my tablets using the F6 key
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 1st Jan 2019 13:00
AtlasCombine.pc is a shader file and should be located in your projects main/shader folder.
Could be, depending from where you copied from not all shaders are in there. But in Tamplates/shader there should be all shader included.
Never had such strange issues using F8/F5
george++
AGK Tool Maker
16
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 1st Jan 2019 13:59 Edited at: 1st Jan 2019 14:02
Hi janbo,
I copied the shader forlder to my project media file. My project has non name yet so I decided to name it "noname". The folder structure now is:
Quote: "C:\AGKProjects\noname\media"

and
Quote: "C:\AGKProjects\noname\shaders"

Although I have no any issue any more by pressing both F8/F5 keys, I still cannot broadcast [F6] my project to tablet:
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 1st Jan 2019 14:35 Edited at: 1st Jan 2019 14:42
Are you sure you mean
Quote: "C:\AGKProjects\noname\shaders"
because it should be located in C:\AGKProjects\noname\media\Shader then
Also make sure to write the folders first letter in upper case as Android is case sensitive.
george++
AGK Tool Maker
16
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 1st Jan 2019 15:24 Edited at: 1st Jan 2019 15:28
My mistake, I mean:
Quote: "C:\AGKProjects\noname\media\shader"

but I cannot broadcast

EDIT: Thank you janbo, the first letter wasn't in upper case. It works now!
george++
AGK Tool Maker
16
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 1st Jan 2019 15:42 Edited at: 1st Jan 2019 15:43
After I managed to run the game on my tablets, I noticed a frame rate drop from 60 FPS on my PC, to 40 FPS on my Asus & Samsung with the use of the water shader
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 2nd Jan 2019 15:10
I my experience shaders are a bit more intense on older hw. On my Galaxy phone no problem. On my old HP laptop from 2007 (and not really build for top notch shaders) it's nearly unusable so there I use janbo's very first "Water for all" shader, which makes a big difference on fps.

Might be an idea to include in the package? But then again, if people want to use it they can download it from the site I guess.
george++
AGK Tool Maker
16
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 2nd Jan 2019 20:41 Edited at: 2nd Jan 2019 20:43
I don't know how fast my tablets are. It is a Samsung Galaxy Tab S2 and an Asus ZenPad 8. I have to admit that I have never played games with high graphics requirements.
This frame rate drop, makes my game not playable, and I'm disappointed, since I do not know how fast it will run on other tablets. I do not claim that janbo is responsible for this but I am wondering if I can make games with AppGameKit that run fast enough as other languages
Is there is something that I have to take care, or this is the limit?
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 2nd Jan 2019 21:37 Edited at: 2nd Jan 2019 21:49
My old water shader shouldn't make a big difference in performance.
You could try to comment out the lines where I mix a bigger version of the textures into the final color values depending on the distance so you can't make out any pattern so easy.
I was asked to add that but it also adds two extra texture samples to it, one for the distortion and one for the normals... should be around line 81 and 92 maybe that helps

Everything else should be faster than before and nicer
With the Water shader one should be able to make a deep sea, a shallow pond and also a swamp and so on, all in one shader, thats why it's kinda heavy
Do you have many objects in your scene ?

Ah and I had no lights for the water shader before, so that might hit the performance too
Around line 105
Just say if I should make performance tests or if it's fine for you to try these things ...I don't want to let you in the dark
george++
AGK Tool Maker
16
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 3rd Jan 2019 15:04
Thank you janbo for helping me.
Unfortunately I cannot modify the shader code since I have no knowledge on this topic.
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 3rd Jan 2019 15:40
I got another Idea why it could be a little bit slower for the mobile version especially.
For many parts of the water shader I need the depth, for example the smooth edges or the water depth color,
but in AppGameKit there is no depth support for mobile devices so I made my own which of course adds a tiny extra cost of performance to encrypt and decrypt the depth image with AGK's toolset.
george++
AGK Tool Maker
16
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 3rd Jan 2019 18:21
Quote: "Do you have many objects in your scene ?"

Does this have impact to the shader?
I don't know yet.
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 3rd Jan 2019 18:41 Edited at: 3rd Jan 2019 18:41
I check if there are objects above and under the sea level and clip them accordingly to the reflections so there is at least that one little check and pixel discard if an object intersects with the water
But again that shouldn't be a big performance hit.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 8th Jan 2019 19:53
The shader pack is great I must say
The only issue i have is i might want to just use one of the shaders not the whole pack at any one time altho it is quite possible to do this with many of them
some of them seemed to be a big part of the pack and, i like the idea of using one of the shaders and not use the complete code that comes with them.
I find them more usefull this way as i tend to write for mobile and i know shaders arent good for mobile usage there is often times when one or two of them
could be handy and not the whole pack.

With that said i love the way you supply the shader code with them, which does allow the above just hard to get some of them to work without the pack.
I am glad it has the code seperate to the shaders, and was skeptical tho wether i should make the purchase thinking they might all be part of a encrypted pack.
So glad they are not, but i did put off my purchase for sometime thinking i mightnt be able to use just one or two shaders without the whole pack, which wouldve
made a decoration on my harddrive and not get any use
fubar
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 8th Jan 2019 20:30 Edited at: 8th Jan 2019 20:32
Yeah I thought of all of that and it's right, you can't just lets say use the SSAO part of the library as it depends on SP_Init, SP_ShaderManipulation,SP_PostProcessing and then SP_Init depends on some other includes again.
In AppGameKit we don't have pragma once, namespaces, pointers or other fancy stuff, so if the files depend on each other then ...they depend on each other
I don't think it's possible to make it like an immediate-mode-effects-library where you set some parameters, draw it and everything is fine.
They work together, you can see that pretty easy with fullscreen shaders if you change the order of those few lines in SP_init you might get a whole different result.
If you know of a better layout then feel free to suggest it here.

But you can get away with those three includes if you strip down the other effect functions from the SP_Init and SP_Lighting file, then the many little functions come to fruition too.
About the raw shader files.. it's probably not communicated to good.
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 27th Feb 2019 15:03 Edited at: 27th Feb 2019 15:07
Little update to show what I'm up to lately.
I made a Cubemapping shader:

Now this doesn't sound special as cubemapping is a standard for decades,
but AppGameKit doesn't give us the ability to render to Cubemaps so the Cube sampler in GLSL isn't useful to us much.
So I made my own using a more compact Horizontal-Cross-Layout, for performance.
Classic Horizontal-Cross-Layout:

Compact Horizontal-Cross-Layout

As you can see you only need to move the top piece into the bottom right corner, and we save a third of the texture size.
My shader is currently capable to render the texture on the fly and calculate the skyboxes fragments like a normal cube map using a 3D Vector like you do with the normal Cube sampler in GLSL.
The single faces are 256x256 pixels in size so the whole cube atlas texture is 1024x512 pixels in size, rendered each frame.
Now all that wasn't my initial goal, but I wan't to be able to create dynamic point light shadows in the future.
As you might now I have the shader code for directional light(sun) and I managed to render depth textures in my shader pack for mobile devices and html5 which doesn't support depth textures by default.
If everything goes well I should be able to take all that and plug them together, to present you dynamic point light shadows on mobile devices.

Aaand I made Paralax mapping:
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 27th Feb 2019 22:26
Beautiful, Janbo!
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 27th Feb 2019 22:33
Silly noob question......how does paralax mapping differ to normal mapping?
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 27th Feb 2019 22:48 Edited at: 27th Feb 2019 22:52
Normal mapping fails at viewing angles closely aligned to the surface. Parallax uses an additional height/ bump map fo maintain the depth at these angles (this does have additional impact on texture and rendering resources, but not a ton)

Really cool work on the cube mapping janbo
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 27th Feb 2019 23:11
Quote: "Parallax mapping (also called offset mapping or virtual displacement mapping) is an enhancement of the bump mapping or normal mapping techniques applied to textures in 3D rendering applications such as video games...Parallax mapping is implemented by displacing the texture coordinates at a point on the rendered polygon by a function of the view angle in tangent space (the angle relative to the surface normal) and the value of the height map at that point. At steeper view-angles, the texture coordinates are displaced more, giving the illusion of depth due to parallax effects as the view changes."
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 27th Feb 2019 23:16 Edited at: 28th Feb 2019 13:12
Normal mapping creates the illusion of depth by darkening the pixels facing away from the light using the normals encoded in the normalmap.
Parallax mapping like the name implys calculates several layers which shift the uv coordinates according to the view direction producing a parallax effect you know from 2D games like starfields.
Now this shader actually is parallax occlusion mapping and has a dynamic range of layers depending of view angle and interpolates between the layers.
I hoped one could see the difference in the illusion of depth
For now you need a heightmap and normal map for it to work but I want a version that calculates the normal from the heightmap so you could draw valleys with only altering one texture(heightmap).
But for some reason I failed at calculating the normal from the heightmap which should be the crossproduct of the distance between the center fragment and two of the neighbor fragments.
Just like heightmapping should work
But I also tried only once to solve that ...so give me another try ^^
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 3rd Mar 2019 20:29 Edited at: 3rd Mar 2019 20:34
Hi janbo,

Was doing a bit of experimenting with the 3d Camera example and added some stuff among which your water shader.
Is there a way to get rid of the very dark patches?


janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 4th Mar 2019 09:01 Edited at: 4th Mar 2019 09:06
Not sure, thats probably caused by not clipping properly.
Looks like a part of the refletion/refraction isn't working.
Did you add the terrain to the sytem with SP_AddObject or SP_Clipping_AddObject.
I can offer you to take a quick look over your code.
You can show the reflection/refraction debug imags with SP_Water_Debug_ReflectionVisible.
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 4th Mar 2019 19:08 Edited at: 6th Mar 2019 18:34
@janbo:
I don't think I added the terrain like that. I just used something I had in Blitz3d with a large texture and detail texture applied to it.
The code is pretty messy, bit of a kludge just to see quick results.


[EDIT]
Forgot to mention: this contains source and media, for I'm not using all the standard stuff(added some stuff).
I didn't use the terrain shader. as wasn't used in the original example too. Do you think this part of the problem?

Quote: "SP_AddObject or SP_Clipping_AddObject."

Wasn't even aware of these.

Would be helpful to have a list of all these commands, perhaps I missed that somewhere.
Also would be cool to have a 'simple' example of the water and ocean shaders (separate from all the combined shader effects) with for instance an textured island, for people like me who do not want to use the terrainshader
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 5th Mar 2019 21:28 Edited at: 5th Mar 2019 21:29
I don't have the artifacts so extreme like you, but if you add SP_AddObject(player and landscape) at the end of your subroutines you register those objects to the library which then injects the clipping code needed by the water effect to properly do the relfection and refraction render images for you.
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 5th Mar 2019 23:07 Edited at: 6th Mar 2019 00:05
Hmmm, rather odd. Must be my GPU then?


I guess you do not literally mean that SP_AddObject(player and landscape) at the end of every subroutine, for that gives me errors:


I can add SP_AddObject(player) to the create_player and SP_AddObject(landscape) to the create_landscape subroutines, but it somehow seems to effect the fog so badly that is being reduced.



And it doesn't kill the dark effects on the water.
Any idea what to do and where to add what or is it just not that suitable for this type of environment?
Would the ocean shader work any better?


[EDIT]
Did a broadcast to my phone, which I then let stream to my TV. There it's far less evident, virtually non-existent. So must be the low fps or gpu.
Thanks anyway for checking.
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 6th Mar 2019 11:30 Edited at: 6th Mar 2019 11:32
@Rick N: You have got a PM.

Yes SP_AddObject(landscape) and SP_AddObject(player) is coreckt.
Also make sure its placed after you made all the modifications to the objects.
I tested it on my notebook and had to remove the precision specifiers at the top of the water.ps file to get it working. It looks a bit like its missing a clamp but it works on all my devices and was tested by some of the comunity too, so could also be a precision thing.
I will review everything on my main PC today and see why the clipping code interferes with the fog.
Regarding the fog effect: I can't take every customisation into Account to work with the clipping injection code, so you might need to do the changes to your shader manually.
Keep in mind it was late for me yesterday and I'm at my mobilephone now
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 6th Mar 2019 16:49
Quote: "Would be helpful to have a list of all these commands, perhaps I missed that somewhere"

A command list is in the User Guide.pdf in your DLC folder at page 18 and higher.

Quote: "but it somehow seems to effect the fog so badly that is being reduced"

If the library knows of your intentions, then it should make all the necessary setup, so use SP_Camera_Range(0.1,200),
also important commands you should be aware of are SP_Ambient_SetColor(),SP_Sun_SetDirection/Color and SP_SetClearColor() in general.
They also do the AppGameKit intetrnal setups for you. Best practice is to use the library functions in the first place so they are in sync.
Well thats hard if you don't know which to use, I understand that
The Next
Web Engineer
16
Years of Service
User Offline
Joined: 3rd Dec 2007
Location: United Kingdom
Posted: 6th Mar 2019 16:52
@Rick Nasher

When sending files please be sure not to include any files that are paid for, I have removed your download link and added a warning to your account. I am sure it was accidental but we still issue warnings.

In future send sensitive files via PM or email instead
Windows 10, Intel i7 4.2 GHz, 16GB DDR4, NVIDIA RTX 2060

Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 7th Mar 2019 13:47
Janbo, could you do something like this?

https://www.assetstore.unity3d.com/en/?stay&fbclid=IwAR3W4rs4EbLhRf8aHzcKiJG9_mVp-wMV8HZyj7ylqc-2CV2MXt7zBzsCP7E#!/content/104029
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 7th Mar 2019 15:42
I guess its a portal with one input but many outputs.
This is an interesting topic which I already looked at myself as portals are usefull for many things.
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 7th Mar 2019 16:13
Yeah, I read about how Spider-Man used this technique, and I'm not gonna lie......I actually thought they had modelled the rooms, spent a good bit of time crawling across buildings looking for the secrets. They use quite a number of different textures though, so the effect is really convincing.
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 12th Mar 2019 19:33 Edited at: 12th Mar 2019 19:36
@The Next:
I've torn my clothes, put ashes on my head and my face is in the mud. To be seriously: I'm sorry: wasn't my intend. Didn't even stand still and think about it, was too focused on the issue(plus some other things on my mind, midst of job change).

@janbo: well.. pls see above. And thanks for explaining. I'm a pretty much a novice when it comes to shaders and the correct workflow is somewhat blurry.(unlike the fog, which is probably my old GPU)

@Santman: unbelievable stuff! Wouldn't have imagined that.
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 12th Mar 2019 20:21
You are welcome and please don't hesitate to ask more questions.

Login to post a reply

Server time is: 2024-03-28 23:21:33
Your offset time is: 2024-03-28 23:21:33