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
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 27th Dec 2019 19:34
Just found the PBR Demo in the Example folder yesterday (thanks Vitium for mentioning it in Discord ).
Looks nice but you can't really use it with moving Objects yet, cause you need to pre bake all and everything.
So I went ahead and made the Equirectangular mapping, used for the reflections in the PBR shader,
with a single rendering step, so one could now generate the Environment maps on demand in runtime in AppGameKit itself.
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 27th Dec 2019 19:35 Edited at: 27th Dec 2019 19:36
Sorry for the tripple post
nonom
7
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 29th Dec 2019 14:22 Edited at: 29th Dec 2019 14:22
Totally agree; @janbo is my hero
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 29th Dec 2019 18:19 Edited at: 29th Dec 2019 18:20
There is still a better way than generating the environment maps as soon as an object moves.
You can setup a bounding box and place those maps in the corners, then you can interpolate between them.
So as long as you move inside this box you don't need to update anything in AGK.
Also you can calculate something called parallax corrected normal which corrects the normal for when you move near the environments bounding box.
But I'm not at that stage yet.
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 29th Dec 2019 18:53
Is it PBR though? Given it's just a diffuse and a normal, isn't it just.....normal mapping?
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 29th Dec 2019 19:01 Edited at: 29th Dec 2019 19:30
Nono, the PBR Example Demo uses those Equirectangular maps to produce those nice reflections.
Now If you try and move the objects in the Demo you'll see the reflections stay the same cause there is no fancy parallax corrected normal calculation nor updates for the Environment map(the Equirectangular one)
But I can create those environment maps in AppGameKit using a shader, so updating them is possible now.
Actually I have the code for Screenspace,Dualparabolic,Cube and now Equirectangular mapping working, there are not many left
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 29th Dec 2019 19:29
No I know, I disected it and put a post on the FB page...Preben still gets credit for the "PBR" demos in Syudio that aren;t PBR at all. Lol.

Shader king Janbo....you'll need to do sme for the World Builder.
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 29th Dec 2019 19:39 Edited at: 29th Dec 2019 19:42
Quote: "you'll need to do some for the World Builder"

I would love to help you out a bit but not too much cause I don't want to ruin mine and TGC's bussines giving shader pack shaders away inside the world builder...you know
Also wouldn't be too fair for those who alrady purchased the pack and I still want to be able to tell everyone that I make real money with a product I entierly made my self
If we create an exe only version, I can make you some here and there...
But please don't think I wont help on shader stuff anymore....definitely not the case !
Bengismo
7
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 29th Dec 2019 22:27 Edited at: 29th Dec 2019 23:24
Hey janbo

The equirectangular mapping is pretty cool and is a much easier uv lookup then cubemaping or dual hyperbolic, so its quick.

I did a very simple scene and have been comparing the different reflection maps


I can generate the equirectangular map and the others two (see above) but im wondering what filtering to do between the mipmaps down the image for texture 2 (is it just a simple blur?) and its not obvious how to choose an exponent value when trying to make a new reflection map (for texture 2). The ones used in the shader are not sRGB and the HDR calcs are new to me.

Are you generating all 8 mipmap levels for the HDR reflection maps too? And are you storing the hdr exponent in the alpha channel like in the demo's?

The lightmaps (texture 3) are stored in the same way...its the first time ive seen HDR packed textures used like that.

AGK teir 2 has GL cubemaps properly built in but its not accessable in teir 1 (arghh). Thats a real shame as it would be good to use open GL cubemaps properly (with accelerated hardware lookups) rather than complicated shader based UV translation version that we have to do in AGK.
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 29th Dec 2019 23:27
I don't think I can convert them into High Dynamic Range as we can only render the environment into LDR images, so if possible, it wouldn't make a difference in apearance if we calculate it in the PBR shader itself, not ?
I'd probably take an example from https://learnopengl.com/PBR/IBL/Diffuse-irradiance and https://learnopengl.com/PBR/IBL/Specular-IBL
But to stay simple you can also access all 8 mipmaps of the texture with textureLod(myTexture, textureCoord, mipmapLevel)
Bengismo
7
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 29th Dec 2019 23:36 Edited at: 29th Dec 2019 23:39
The PBR shader uses HDR textures in the demo ....so its textures have RGB values and A is the exponent for a pow (RGB,(Alpha*256)-82)....so the colour values used intenally have a huge range ....like >5million vs 0-255 for LDR

It would be possible to render the reflection map with the larger dynamic range I guess.

The PBR shaders use the IBL specular reflectance already.....Thats all done.

What i meant is that the reflection maps that it uses are actually 8 different maps at different mip levels so that roughness and blurred reflections work properly. They are mipmapped down the images vertically (not actually mipmapped in open GL). The reflection map is 8 images stacked vertically.

Ive got a shader working tonight that works out the 8 levels and applies a blur to correctly produce the right result but it takes 2 steps instead of one.

The PBR example shader uses all 8 levels to produce reflections depending on surface roughness. Its really cool and interpolates between the levels. The shader always uses the top level to control the bluring internally based on the roughness value stored in the alpha of the normal maps.
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 30th Dec 2019 00:10 Edited at: 30th Dec 2019 00:28
Did't venture too much into the Demo. Where do you see it using the OGL mipmap levels ? which you'd use for roughness(not talking about the stacked images)(forget that)
If we don't mind using two steps we could use the texture2Dlod to produce the 8 stacked environment images.
I'm probably missing something...to late for me...good night ^^
Bengismo
7
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 30th Dec 2019 00:20 Edited at: 30th Dec 2019 00:23
Quote: "Did't venture too much into the Demo."


Fair enough.

The demo uses HDR images for the reflection map (texture 2) and the light map (texture 3). Both these textures have a exponent stored in the alpha value so that the range of brightness/colour values stored in those textures is massive and creates a much more realistic result in the final image especially when used with the ACES tone mapping. Its the same tonemapping used in various newer engines.
Each of those images is also actually 8 images stacked in the y direction . No internal open gl mipmapping is used as it produces horrible results with blocky squares. Instead 8 levels are generated by sucessively blurring the reflectance map and lightmaps. This is done with the HDR being used too so its super accurate and creates really lovely accurate smoothed reflections. The

Quote: "Where do you see it using the OGL mipmap levels ? "
It doenst use open GL mipmap levels...it has 8 images in the one PNG file stacked vertically. As I said above...the detail levels are stored vertically. The roughness and fresnel reflectance calculate which two levels to use and blend between for each pixel.

Quote: "If we don't mind using two steps we could use the texture2Dlod to produce the 8 stacked environment images."
You dont want to use open gl LOD levels for this as the results are terrible.....plus they dont work on a HDR image anyway.

Quote: "I'm probably missing something...it's midnight in germany...good night ^^"
Goodnight....lol same time here.

Im thinking preben or GaborD wrote those shaders or borrowed them from somewhere..
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 30th Dec 2019 00:43 Edited at: 30th Dec 2019 00:56
Besides knowing it uses the alpha channel to calculate the hdr values and the environment being 8 stacked blurred images, I looked into the shader again a you are right about the roughness, also prebaking the environment maps using a nice blur will produce a nicer result indeed.
So what blur algorithm to use, gaussian ?
(Hammersley sequence?)
And do you use all 8 texture stages of a shader or 8 sprites to combine your texture atlas.(im using the shader aproach)
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 30th Dec 2019 09:59
Perhaps this needs a new thread?
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 30th Dec 2019 10:36 Edited at: 30th Dec 2019 10:47
[Edit]Made a new thread for this [/Edit]

The right Object I have added uses the Cubemap and a PreFilterConvolution shader which produces those nice blurry effects.(You beat me to it)
I think anything else than cubemapping would produce wrong results here.( as you'd need to incorporate the streching at the top and bottom somehow)
Not sure If I should try to create an equirectangular map from the final result

Attachments

Login to view attachments
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 20th Mar 2020 09:51
I've not read right through this massive thread but I notice Edge Detection is not mentioned in the purchase page. Ironically enough it's the main one I would like.
Is it no longer available? It is perfect for many of my CAD projects!
Using AppGameKit V2 Tier 1
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 20th Mar 2020 22:05 Edited at: 20th Mar 2020 22:09
The websites just aren't up to date.
There is EdgeDetection but it can only handle narow lines as every other algorithm would be quite to performance heavy for my taste.
What are you up to ?
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 21st Mar 2020 01:04
WOW !

I have not read through the entire thread either, but that image above is truly worth a thousand words.

Absolutely amazingly cool.

Quote: "Shader king Janbo...."


Most impressive Janbo, and I have to agree that you are the shader king.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 21st Mar 2020 21:23 Edited at: 21st Mar 2020 21:24
Well thanks, but the only contribution to the image obove is the Cubemapping,Equirectangularmapping and PreFilterConvolution shader to make real use of AGK'S PBR in the future.
Check out this thread: PBR Tests
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 17th Apr 2020 17:19 Edited at: 17th Apr 2020 18:33
Hey,

I revised the Godray shader and made it switchable between directional and positional godrays too, wich could be useful for a solar system for example
Lorenzo
8
Years of Service
User Offline
Joined: 19th Dec 2015
Location:
Posted: 2nd May 2020 23:43

if I apply to an object the TOON shader does not receive the shadow.
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 3rd May 2020 17:33
Yes, thats because I have no way to acces AGK's Shadow calculation without using AGK'S GetPSLighting() Function generated at runtime.
I can't have Toon Light and AGKS Light.
I would need to create a complete shadow rendering system to work around it and make it possible for the toon shader to recieve shadows.
Casting shadows should work though.
Lorenzo
8
Years of Service
User Offline
Joined: 19th Dec 2015
Location:
Posted: 3rd May 2020 20:26
yes, I confirm that casting shadows works.
It is a pity.
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 4th May 2020 14:10
If Paul makes seperate function for lighting and shadows or maybe gives us acces to AGK's Model, View, Projection Matrices and some other uniforms, it could be quite easy and fast for me to imitate AGK's shadows, but thats not the case sorry.
If you have shader experience you could take my toon shader and my custom shadow shader and combine them, but then you need to use this system for all your objects to get consistent looks.
Lorenzo
8
Years of Service
User Offline
Joined: 19th Dec 2015
Location:
Posted: 4th May 2020 21:42
maybe but with shaders I'm a goat.

jd_zoo
6
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 13th Jul 2020 00:35 Edited at: 13th Jul 2020 03:47
Hi janbo - thank you so much for creating these the effects look fantastic. I'm trying to apply basic shaders to an existing level in my game, the issue I'm having is in clearing everything when exiting to the main menu.




So I assume I need to remove all the shaders when I'm clearing everything. I've tried the following method:



Then adding this to an existing object in an existing level:


And adding this to my clearing routine:


I'm seeing my Message pop up (showing the matching ID) before the error so not sure what else I need to do here? Thanks!

EDIT: My current work-around is adding a flag for the level .hasShaders that gets passed to my screen controller. My main loop looks for it and only calls the SP_Sync() when its active. Still seems like I should be able to remove the shaders and clear everything tho?



EDIT #2: That doesn't actually work, after exiting the level and then re-loading it looks as if the Shader Pack is still using those objects after going through the process of removing them.

Attachments

Login to view attachments
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 13th Jul 2020 08:54 Edited at: 15th Jul 2020 13:12
I have a SP_Global Array that stores the all the objects and attached shaders SP_Global[0].ShaderID you could use this for your bulk removal.
I guess the Error pops up because there is an object that still has a shader attached to it. Use SetObjectShader(ObjectID,0) to unbind the object from all custom shaders and use AGK's default shader instead.
The Outline,Fur and Xray effects are a bit special as they use an extra array to render the effect so one can combine those effects with other shader pack effects.
So best you use SP_Outline_RemoveObject and also remove all shaders form the global SP_Global array.

I could fix this easily by not inserting those effects into the SP_Global array as they don't need it for them selfes, but other effects do, and then you'd end up adding those special effects via SP_AddObject too, so you add them twice.
If many more get this problem I might do my fix.

for the last Error that you got, it seems you are using a fullscreen shader for which i don't have a remove function (only activate and deactivate), but you can unbind any shader from the Quad Object, which is used to render fullscreen effects, using SetObjectShader(ObjectID,0) again.
jd_zoo
6
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 14th Jul 2020 02:59 Edited at: 14th Jul 2020 03:20
Hi janbo, thank you for your response. Unfortunately the problem persists with the water shader and not the outline. This is my first crack at shaders so anything else would be included with AGK. I have setup a different clear for each type of shader, this is the water one:



I did try changing SetWindowAllowResize() to 0 with same result but I suspect that's not what you mean by "fullscreen shader" (really am new at shaders here...) Thanks!

EDIT: To clarify, the second error message that I posted previously is the problem. A guess is that the normal map texture is still is use by the water shader even after removing with SP_Water_RemoveObject(). I am using the energy shield without issue and it has two textures associated with it, perhaps just related to water?
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 15th Jul 2020 08:56
Quote: "The websites just aren't up to date.
There is EdgeDetection but it can only handle narow lines as every other algorithm would be quite to performance heavy for my taste.
What are you up to ?"

That's fine thanks, I don't come here very often any more but that is what I needed to know.
I often work on my own little CAD tools and that effect looks great for 3D CAD. I may purchase for this and the wireframe in particular.
Using AppGameKit V2 Tier 1
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 15th Jul 2020 13:05 Edited at: 15th Jul 2020 13:17
@baxslash: I know you can handle shaders verry well, but fidelling with code from another coder is ...well you know you can ask me indepth stuff to give you a head start if you want to do cusom things (that counts for everyone else too ofc)

@jd_zoo: You are absolutely right the water shader has bound several images one of them is an Atlas texture of the reflection and refraction from the cameras view which needs to be rendered into extra RenderImages.
I was overlooking that crucial info of the file path that says SP_Water.agc
So Try deleting/removing/unbind the Images before unbinding the shaders.
Do you use DeleteAllImages() ? if not it could be that the library tries to use the old images in the wrong order(after vulcan was implemented we can not read and write from/to the same image anymore so we need temporary RenderImages and ping pong between them in shot: the order is important)

In which cause you could in theory try to delete the Old Render images which you can get with SP_Water_Reflection_ImageID,SP_Water_Refraction_ImageID,SP_Water_Atlas_ImageID, PrevRenderImageID and NextRenderImageID
And then if you load your game again:


This isn't ideal, not even near...I'm aware of it.
So my library doesn't handle cleaning behind it verry well, I guess but, you don't really need to clean everything if you reuse it again anyway, what will a few unbound renderimages or shaders do to the performace ?
Maybe you can find a way to not unload everything so the second time you start the game again it's loading even faster
just a try to distract from my cleaning problem I guess ...which stemps from not trying to reinvent the wheel again as AppGameKit sadly gives us to little access to do it without workarounds.
jd_zoo
6
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 16th Jul 2020 00:55
Hi janbo, as this is my first proper game (and biggest thing I've ever created...) and I may have approached my "screen controller" in the wrong way. Performance is not a big concern for me as its a coding / puzzle type game that uses 3D stage sprites and physics - so because each puzzle is unique I went down the rabbit hole of clearing most everything when I exit to menu or re-start a level. That said I keep all my user menus and a lot of textures in memory thinking that would be good performance practice (oh the irony...), so the DeleteAllImages() opens a different can of worms. In the end I may have to re-work the way I clear out game data and stage objects - all part of the learning process as I can't tell you how much of this I've re-written as I've gone along this crazy journey. I was blown away when my simple cylinder object transformed into a cool glowing fluid tank using an energy shield for the glass, I think it will be worth the effort for me to sort it out and get your water shader going.

Thank you for the help and stay safe everyone!
John
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 16th Jul 2020 14:09
Aw I really want it to work for you now, hope you can get it working and finish you project.
jd_zoo
6
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 18th Jul 2020 02:50
Ok I'm back at this and have an update on deleting of the water shader, I've got the following parsed together below:


First thing I'll note about above is that PrevRenderImageID and NextRenderImageID are not global so that is why they are getting passed along with the object to create this water shader "tracker type". I have also added in the SP_RenderImage_SetSize... code you had in your reply, I'm calling this regardless on if its the first or second time the level was loaded. Please clarify this bit for me if its not as simple as just calling it whenever I add a water object.

The following is the data I'm getting when first loading the level. When I exit to menu or restart the level, these images are now getting deleted in the updated clearing code above without error.


Now when reloading the level I get two error messages, first is failed to render to color image 100115, which would be the reflect image. The second error is referencing an image number which was generated during the RELOAD, and did not exist during the first load.



When I reload the level all image IDs should be reloading in the exact same order. The water normal map is retained in memory and is reused on reload. Just hoping I can keep kicking this can down the road, any additional thoughts are appreciated

janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 19th Jul 2020 20:07
This looks about right.
Calling SP_RenderImage_SetSize everytime is ok as you just make sure the renderimages will exist before you call SP_Sync()
I'd try to set the SP_Water_Reflection_ImageID variables etc to zero, as those errors look like it tries to reuse an image thats not there cause the ID's have a value > 0
jd_zoo
6
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 20th Jul 2020 00:46
Setting the following to zero eliminated the first error. I've put this upstream from my object creation so that PrevRenderImageID and NextRenderImageID are in scope.


New error:


The image ID the error is referencing is the newly generated SP_Water_Reflection_ImageID. Trying debug here and it appears that the error comes up when SP_Sync() is called but that's probably obvious to you, I can get the new SP_Water_Reflection_ImageID() before it gets to the sync to verify thats the image in the error. When the program halts I'm now seeing the left half of the screen is rendered correctly (water shader showing), the right half is the complete viewing area compressed to fit. I tried playing around with adding in an extra SP_Sync() to push the remove_objects through and that causes all kinds of funkyness. All 2D sprites overlay correctly it is just the 3D objects affected (again, probably an obvious point for you but this is all new to me.)

Side note - while running debug I've had to disable all outline shaders as it is generating repeated warnings, I'm assuming that's just the nature of the beast for the outline shader?

Thanks!
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 25th Jul 2020 10:45
Dear Shader pack users,
I was wondering if I should create a second demo for each effect which doesn't use the library, so those of you who want only a specific effect or customize it a bit, have it easier to do so.
I see the pack a bit like the shader them selfes is the produkt and the library comes for free, although I want to support it wherever I can.
The 2D Shader Pack is on hold anyway, cause I'm waiting for TGC to implement something like SetSpriteShaderConstantByName( ), so I can fidle a bit with my 3D shaders again.
jd_zoo
6
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 25th Jul 2020 23:17
Quote: "Dear Shader pack users,
I was wondering if I should create a second demo for each effect which doesn't use the library, so those of you who want only a specific effect or customize it a bit, have it easier to do so.
I see the pack a bit like the shader them selfes is the produkt and the library comes for free, although I want to support it wherever I can.
The 2D Shader Pack is on hold anyway, cause I'm waiting for TGC to implement something like SetSpriteShaderConstantByName( ), so I can fidle a bit with my 3D shaders again."


That would be cool to see janbo!
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 26th Jul 2020 13:13 Edited at: 26th Jul 2020 13:17
Hey jd_zoo
I started with the water effect, as you might figure out what you need to make your project working.
Every Demo I do like this, will still need the SP_ShaderManipulation.agc file to load the encrypted shader, which I obvously can't share, but I guess the Demo code itself I can just put here for the start.

Made it in 1hour i think, so if you have problems I'll update this post.
It may also not work with the current released version, so I might need to create a relase version again to get you up to date... we will see I guess
george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 26th Jul 2020 15:04
Quote: "The 2D Shader Pack is on hold anyway"

Are there any details more on this?
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 26th Jul 2020 15:47 Edited at: 26th Jul 2020 16:09
Nice work Janbo. I've purchased the shader pack from Steam.

Just trying my luck, but is it possible for you to make a 'log-roll' shader? Like the one they use in Subway Surfer and Animal Crossing?
Would be great if the log-rolling shader can work along with preexisting 3D-to-2D commands such as GetScreenXFrom3d , to get the screen 2D positions from 3D world after it has been logged-rolled. I imagine it would involve some workaround to get the 'correct' 2D screen coordinates after log-rolling.
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 26th Jul 2020 15:56 Edited at: 26th Jul 2020 17:23
@george++: yes you have a pm

@BITBITBIT: Sure should be easy, I'll look at it later.
[Edit]Here you go:


For questions please ask in a seperate thread thanks.

Attachments

Login to view attachments
george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 26th Jul 2020 17:20
Thank you janbo, I'll keep an eye on this
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 26th Jul 2020 18:05 Edited at: 26th Jul 2020 18:06
Whoa that's quick. Can we adjust the log-roll shader so that it's only rolling in z-dimension (back-front)?
It seems like the world also is rolling in x-dimension (sideways)

Oops sorry. Will ask more later in separate thread. Thanks again.
jd_zoo
6
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 26th Jul 2020 21:14
Hi janbo, I've commented out line 127 ["//WorldObjectID=LoadWorld("Map/SP_Showcase.x") ] and had to make SP_Depth_CurrentImageID global to get it to run, results in the following output:



There is no animation just the mirror looking surface. If I understand the intent this demo shows what the shader library (SP_sync) is processing each time? I see it switching between the Current and Prev image, so maybe my making Current to global brakes something. The error when not making the SP_Depth_CurrentImageID global is the following: "./../Templates/ShaderPack/Includes/SP_ShaderManipulation.agc:78:Erroe: Variable "sp_depth_currentimageid"is used without being defined or initalised"

As far as my example goes, I'm likely guilty of programming like its still 1999 and can afford to keep 20mb of level data in memory so a re-work of my screen controller is still in the future. I've got few core features left and lots of polishing ahead of me but the screen controller and shader graphic system, among a few other things, are something I'm hoping will be robust and easily transferable to new projects so worth taking my time.
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 26th Jul 2020 22:00
OK, thats due to an error I had in the old version.
If you want to try it now I'm happy to send you the new file.
And that also means I have to release a new version.
jd_zoo
6
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 27th Jul 2020 02:54
Please no rush for me, like I say lots of stuff I have to work on, really appreciate all the great feedback on this and I'm confident things are going to work out in the end one way or another. If there are delays in releasing new version then I'll pester you when I get back to it. I think it would be awesome if can use the shaders individually as that is what I imagined was the scenario when I purchased the set originally. In the future I will know better to take advantage of your library interface properly.

Thanks!
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 29th Jul 2020 12:48
Hello. Noob question here. But how do we update the shader pack DLC in Steam? I haven't updated it since I bought it some times ago. But I didn't see any option to update DLC anywhere.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 23rd Mar 2021 20:27
Could you elaborate on the parameters passed to SP_Terrain_SetHeightBlending(ObjectID,RedDepth#,GreenDepth#,BlueDepth#,AlphaDepth#) please?
James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 23rd Mar 2021 22:57
@blink0k
Often wondered the same! I am guessing its shader constants for the splat map, so in the demo you have 5 textures plus splat map, if you look at the splat map only the alpha channel seems odd in as much as it is basically the same as the alpha channel of the dirt height image rather than what I had expected would have been a normal splat, the rgb channels are the layout of the remainder in what I deemed as the normal way of splatting, I have assumed one must be a base texture applied everywhere that is black on 1 of those channels OR it is somehow combined with the alpha channel twice, and the other 4 must be for each splatmap channel. This all has to work/fit in with the first option of NOT using blend heights whatsoever(SP_Terrain_AddObject) just to add to the confusion...in fact looking at the visual result with no height blends it looks like the sand texture isn't visible anywhere.

So the reason for me posting that nonsense thought process is...I might have actually altered the splat texture alpha channel at some point early on. Worse than that I did not back it up...any chance you can confirm what is in the alpha channel of the splat map so as to save me reinstalling for the sake of 1 image? I may have messed with it or not, I don't recall as it was months/weeks ago now! I have limited internet atm so don't want to have to dl it again, cheers.

@janbo
The main reason for me posting is I would also like information along the lines of blink0k's request but also explain how the none height option plays out along side this, also the normal's for textures appear to come from alpha channels of each image and there is also no calculation of bi normals used in the sahder that I can see, so um in DBP there's this shader with per pixel lighting which I used with a mesh making exercise, but in order for it to show up as not all black surface(ie failure) I had to include bi normals in the fvf(vertex format) of memblock mesh...is this something I would have to do in a mesh in AppGameKit to work with this terrain shader instead of the standard terrain setup? Is there an example of this anywhere that I have overlooked? I can see in the collection project normal map is applied but I don't see any shader and I really don't want to start taking that demo apart because I am not good enough lol - AGK/OGL seems weird in as much as for per pixel lighting it appears it is done as an option behind the scenes so to speak ie its done in the lighting set up rather than the shader - how does this tally up, is there such a thing as per pixel lighting shader in OGL, or does AppGameKit take full control of it ? I am befuddled! I would really rather take full control from AppGameKit with respect to this if it is indeed the case AppGameKit takes care of it behind the scenes/under the hood...much like you appear to have done for transparent shadows with the light scatter project.
Win 7 Pro 64 bit SP1, AMD A4-5300 APU 3.4GHz, 8GB DDR3, NVidia GeForce GTX 750 1GB GDDR5, ASUS A55BM-E

Login to post a reply

Server time is: 2024-11-23 12:00:34
Your offset time is: 2024-11-23 12:00:34