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 Studio Chat / Porting DBP shaders to AGK

Author
Message
EVOLVED
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: unknown
Posted: 11th Jan 2024 14:34 Edited at: 3rd Jul 2024 00:09
Just want to let the agk community know that Im in the process of porting my newly updated Dbp shaders over to Agk and they might be useful for some of you.

lighting system


Post processing


Shadowing


Lighting


Environment


PBR


Miscellaneous


Reconstruction


shaders are free, do what you want with them.
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 11th Jan 2024 19:21 Edited at: 11th Jan 2024 20:24
Finally, I've been waiting for this days for 10 years ( or at least feels like 10 years).
Advanced Lighting was a mandatory addtition for DBPro https://www.evolved-software.com/advancedlighting/advancedlighting

Are you planning to do Post Filters too? With the Bloom, HDR lighting, SSAO and everything?

EDIT: These pages/shaders seems to 404:
AGK-Bump Refractions.zip
AGK-Parallax Corrected.zip
EVOLVED
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: unknown
Posted: 11th Jan 2024 21:24 Edited at: 11th Jan 2024 21:25
The links should now be fixed, Some of the post filter shader might be a bit difficult to convert as there seems to be no option to use different texture formats when some shaders require rendering to rgba16f target such as the hdr/ssao for floating point accuracy.

I've done the conversions of the two pbr samples (I will do some more at some point) and that concludes the easy shaders to port over. Im now working on the shadow map shaders.I have noticed that agk dose not seem to calculate tangents for normal mapping so there is a CalculateObjectTangents(iObject as integer,iMeshIndex as integer) function you will need to call for shader with normalmaps (not sure if it will work on bone meshes mind you).
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 11th Jan 2024 23:10 Edited at: 11th Jan 2024 23:19
oh, my thanks for this and whatever else you bring to the AppGameKit side of things, evolved.

a couple thoughts:

1) are these tested in Classic or Vulkan-only? i'm ignorant to shaders but i think there might be differences and since you posted in Studio, i wonder.

2), drop a screenshot or 2 into the first post and this would probably be better kept in the AGK Showcase board? i'll be happy to move it there.

3) project added to the AGK Resource Directory for quick reference

thanks again!
James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 12th Jan 2024 00:33
Thanks so much, excellent as always
Win 10 Home 64, Intel(R) Core(TM) i5-10300H, 8GB DDR4, NVidia GeForce GTX 1650 4GB GDDR6
Dark Raven
10
Years of Service
User Offline
Joined: 27th Jul 2014
Location: United States
Posted: 12th Jan 2024 01:46
Tested a couple of them and these are great thanks. I've also tested in Classic and can confirm that these WILL NOT work with classic. In studio it seems that the version of glsl that is a higher version. Even if you set to "basic" in studio you will get compile error in the shader language. But for studio these are pretty cool shaders. Thanks Again.
Sph!nx
15
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 12th Jan 2024 13:42
Wow, great stuff. Always loved your work!!
Regards Sph!nx
EVOLVED
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: unknown
Posted: 12th Jan 2024 16:58 Edited at: 12th Jan 2024 21:34
I've updated all shaders today, some should now work with #rendering set to basic. If a shader has equirectangular mapping (used for reflection/pbr/cube light example) you will need to change "textureLod(texture,uv,mip)" to" texture2d(texture,uv)" (remove the mip value) in the ps shader, this is used to remove a texture seam with the equirectangular technique and produce roughness effect.

speaking techniques, I'm not haveing much luck converting the shadow map shader. In DBP we have techniques as part of the hlsl file, so you can use these to swich between different shader effects in an efficient manner. To try and emulate this, I have made some "effect" functions which the newly updated shaders now use.
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 13th Jan 2024 15:18 Edited at: 14th Jan 2024 12:33
Wow that's a surprise !

I left my shader work on a system where you can place bounding boxes for a parralax corrected PBR shader in an editor and then interpolate between them depending on the objects position using SDF's. (barycentric coordinates where an option too)
While those shaders are already more usefull than the PBR shader that came with AppGameKit Studio we are still missing some good tools to create the textures and data for those effects like the equirectangular textures for example.
Normally i'd say that i try to put some code together to render those equirectangular maps inside of your AppGameKit Levels but i don't have any time lately and i even got most of the code already.
But maybe those features will come with Mapscape 3 ?
Anyway thank you for sharing and by the way your work for DBPro is part of why I made the shaderpack and it's nice to once again scroll through your code.
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 13th Jan 2024 23:05
Awesome work, Evolved legend. Small request as well i have 2 shaders i was working on here that ive given away for freely but there not fully compatible and are missing some lighting ect if you would like to take a look maybe you could tweak them a bit and redistribute them for use https://forum.thegamecreators.com/thread/229443 i Will be using your shaders soon. Agk has needed some community shaders. Point light shadows it what kept me from working on a few projects

Qube_
10
Years of Service
User Offline
Joined: 21st Oct 2014
Location: Omnipresent
Posted: 13th Jan 2024 23:14
Wow!, these are very impressive and generous of you to share. Wish I could understand how to do shaders but my brain just doesn't understand a thing. Perhaps I'm overcomplicating things in my head
EVOLVED
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: unknown
Posted: 14th Jan 2024 11:43
Just converted the world reconstruction form depth shader, this means I can convert the SSAO shader. This is quite usefull for deferred rendering and you could actually use this to set up a light pre-pass render by rendering normals xy+depth then do lighting calculations and proj lighting results back over geometry (crysis 2). The shadow shaders are mostly done, not too happy with some of them mind you so will come back and have a second look. Point light shadows will need an alternative way and will look at this at a later date.
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 14th Jan 2024 11:58 Edited at: 14th Jan 2024 13:29
Alright i did it anyway and found the time this morning.
I added the ability to render the Equirectangular maps without going through cubemaps inside of AppGameKit directly.
I adopted EVOLVED's coding style and added a self contained CreateEnvironmentMap command into the common.agc wich you can pass the effect to render with and the width and height of the renderimages.
I also altered the LoadEffectTechnique to accept fullscreen shaders.

You can see here I added a third object wich is reflected in the environment map of the center object:
Download: Equirectangular Reflections

Attachments

Login to view attachments
EVOLVED
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: unknown
Posted: 16th Jan 2024 00:17
All shaders have been updated as I have done some work on the "Common.agc". I've uploaded a skinned mesh animation/fast bone shader just to make sure the altered CalculateObjectTangents() function would now work with objects with animations, as this function now works by adding vertex tangents to an existing mesh attributes.

I'm now taking a small break from agk to do some work on treeit.

@janbo
Ive added your LoadFullScreenShader() change to the Common agc. Did not even know this command existed, is there any other usefull commands that exist like set cameraclip or setobjectcolorwrite?. ColorWriteEnable was so darn useful that I relied on a lot with dbp hlsl shaders as you can render different single channel effects or objects onto the same render target.

There are some things that I'm finding quiet bizza with agk like only having one camera but there is a camera ID, just feels half finished. I also take it only 32bit rgba and 24bit depth textures are the only texture formats that agk has ? no rgba16f etc ?. Is agk even still being developed as I've only just started using it last week, despite owing a copy for some time it just seems like there some useful rendering stuff missing (wireframe+point rendering also being very useful).

Good job on ther equirectangular reflections might see if this can be adopted to render point light shadows. I've made some changes to "Shared Shadow Maps" sample which combines the 4 24bit depth maps into one 32bit rgba texture as a postprocess pass, maybe something similar can be accomplished when creating an equirectangular map.

janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 16th Jan 2024 08:30 Edited at: 16th Jan 2024 09:06
Yeah there are quite a few commands that feel that unfinished.
And the support has decreased a lot, but rumors are that TGC will make AppGameKit some kind of Open Source.
There are commands to load shaders from strings now LoadShaderFromString so we can generate em or add define values to activate different parts of code for example. So we could create ubershaders that does it all.
There is the command SetCameraBounds to create a off center projection and you set the near and far clipping plane with SetCameraRange verry usefull to only render into parts of an image.
I tried to render point light shadows using equirectangular maps too, but only ever made it for cubemaps really.
I also always try to be compatible with AGK's generated shadercode so the comunity can still use the build in commands on the objects so have it easier to get started.
If you get it working properly make sure to also render a stack of the shadow maps below each other in one image so we have several point lights and don't use up all texture stages as we need them for other stuff
Doing this for cubemaps is kinda ugly if you try to stack them as you want to save space so you pack em in an F formation and every second image you have to mirror the formation ect.
If you also want to support mobile we have to encode the Depth map into an RGBA image and decode it in the shadow shader later again:

Also i noticed you still use Dim and undim but we can do this now:

And did you find the ref keyword for calling by ref in functions ? only for custom types tho

How come you're looking into AppGameKit ?
EVOLVED
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: unknown
Posted: 26th Jan 2024 04:15 Edited at: 26th Jan 2024 04:19
Just a quick update, as I have now managed to port over most the currently available shaders over to AGK.

There now is a point light shadow mapping sample that makes use of dual paraboloid mapping, I did try this with equirectangular maps but there were errors towards the top and bottom. I did struggle to port this over to agk at first, the issues was a real need for multiple cameras as using the same camera over and over again was just real mess. So I've now added some usefull camera functions to the common.agc code base to which all the samples now use.

I've also made two new agk only shader samples, one is "AGK Lighting Parallax" which just combines parallax mapping with agks generated shadercode so the inbuilt lighting/fog system is used. A simple bloom shader is another sample which I think look pretty decent for sRGB limited color range, there is also basic eye addaption added that chages the objects brightness rather than being a part of the post processing pipeline (same method as agks tonemap shader sample).

I'm now looking at working on a merged shader sample that combines Bloom, Dof, light scattering and fxaa.

@janbo Thanks the info!, I did have a look into agk generated shadercode and ended up adding it to most my basic shader samples such as toon/fur/environment shaders. Set camera bounds was also usefull for a custom set "CameraView" function as part of the added camera commands, the only downside is clearscreen() clears everything regardless of what the scissor is set to.
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 29th Jan 2024 17:47 Edited at: 29th Jan 2024 17:56
Thats a nice set of camera commands and i never thought about using one byte of depth and combining them as a depth map into one image but i guess the limited precision doesn't matter for nearby objects or lights with a low range.
My wish for AppGameKit is to combine PBR with Parralaxcorrected environmant maps and all kinds of shadow mapping
with the objects automatically interpolating between the best prerednered environment maps and all that without the use of external Editors in AppGameKit for wysiwyg.
EVOLVED
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: unknown
Posted: 31st Jan 2024 02:10 Edited at: 31st Jan 2024 02:12
All shaders have been updated to fix an issue, I some how failed to normalize the normals and tangent vectors which would result in incorrect normals if you were to scale objects so this should be now fixed!.

Also added some new shaders samples "snow" and a "matcap" using a thermal vision texture. There is also a PBR lighting sample to which combines most of the shaders so far. I did rework the "Dual Paraboloid" shadowmaps to use just single shadowmap texture as I did plan on adding this to the new "PBR lighting" sample, but the pixel shader instruction count was getting a bit high so I left it out. If any one wants, I could still add it to the sample so we can have 8 lighting array lights + 4 point shadowing lights on screen at any given time but the performance would be pretty dire.

@janbo
I have given it some thought on how a real time lighting system could be added, the way I would go about accomplishing this would be using a pre-pass system with overlapping shadow masks and a reflection render.

Geometry pass 1) Render Depth + Normals xy with fractional values in zw for extra normal precision (might not be necessary mind you).

All pre-pass renders done in a deferred rendering manner:
Pre-pass 1) Render shadow masks 1, incorporates directional shadows in red channel and the fist 2 overlapping point/spot light shadow masks in the green/blue using additive blending.
Pre-pass 2) Render shadow masks 2, incorporates 3 more overlapping point/spot light shadow masks, this only needs to be rendered if more than 2 on screen lights have an overlap (still using additive blending btw).
Pre-pass 3) Render reflection probes, largest to smallest in RGBE8 format. We can use noise to create a transitions between probes so no alpha blending is needed.

Geometry pass 2) Render our lighting results making use of the above pre-pass data, I'm hoping that the depth buffer is still intact so we can just use SetObjectDepthReadMode=equal and render to the same rendertarget to make use of early z rejection (just like the depth prepass method that most other game engines use).

This will allow you to have parallax corrected reflection probes + multiple on screen shadowing lights, but there would be a limit of 5 lights that can overlap at any given time (not to much of an issue as lights are usually spread out). Lights will have to make use of an inscreen/in view frustum light array, if there are 50 lights on screen, we will have to cycle through 50 lights each pixel. We can make use of the shadowing prepass masks to create a bunch of optimizations on whether or not to do the lighting calculations though, A tiled render(if possible) here would also help performance.
James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 31st Jan 2024 05:52
The new PBR looks sweet. Thanks yet again! " If any one wants" depends on how much of a hassle that would be for you, if nothing else it would be really interesting to see how dire
Win 10 Home 64, Intel(R) Core(TM) i5-10300H, 8GB DDR4, NVidia GeForce GTX 1650 4GB GDDR6
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 3rd Feb 2024 01:34 Edited at: 3rd Feb 2024 02:00
Nice you incorporated rendering the reflection probe aka. environment map in AppGameKit for the PBR Demo ! but you used that probe/map for all objects ^^
Your system sounds like only the shadow and lighting part is kinda deffered and the rest is still forward rendering ? do i understand that correct ?
I don't know how one would do reflections in a deffered way anyway ^^ or are reflections always deffered since that only means that it is processed at a later stage and reflections always involve environment maps in between
For your snow shader i wouldn't use a random sampling method as it flickers when the vertices are being deformed so maybe use SetShadowSmoothing(3)
And parralax correcting the environment map would be beneficial for the PBR Demo too i think, as you'd see the floor in the cube reflections better.
wait a minute they are parralax corrected but the bounding box is setup so it looks infinite...did you do that cause the cubes are also in the Environment map and it would become more obvious ?

I love what you do and im happy that i still understand it all...probably until you start with deffered shading cause i only dabbeled with it a tiny bit but I'm exited for that
MateiSoft
12
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 15th Feb 2024 10:04 Edited at: 15th Feb 2024 10:05
Very nice work indeed!
I have a small question: Can these shaders work on TIER 2?

Thank you!
www.alexmatei.com
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 6th Mar 2024 12:34 Edited at: 6th Mar 2024 15:49
Thank your for your continuous great work. Happy to see you're having breakthough with post-processing. There is no need to ask, I'm 2690% sure everybody around here wants PBR, so as your other shaders such as the tree and cloud shader that you have made for DBPro. This reminded me of the excitement of when Janbo introduced his Shader Pack a few years back. AppGameKit sorely (or rather desperately) needs these visual enhancers.

I'm not sure if the tree shader can be used for grasses, but if you are looking for suggestions, may I suggest grass shader next? Something like Black Desert Online grass
https://www.youtube.com/watch?v=ozwyUwijQlM
And before I forgot, vertical fog shader.

Seriously, why aren't these featured on TGC Newsletter yet? These should have become the frontpage, or rather, THE newsletter itself. A permanent fixture. Pin it to the top of the forum too. Also pin it to TGC website login screen for good measure. That's how important these projects are to AGK.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 6th Jun 2024 00:12 Edited at: 6th Jun 2024 00:29
@EVOLVED
I've just noticed there's a link to DOF shader under Post Filters section that doesn't seems to work:
http://www.evolved-software.com/shadersnew/wpostprocessing
This is the exact link to the file:
http://www.evolved-software.com/shadersnew/postprocessing/DOFAGK.zip
When I tried to download it, the browser says that it might be virus, and deleted it. Tried with both Chrome and Edge, can't keep the files. It's only for that file though.
Is it possible to re-upload it? Thanks in advance.
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 6th Jun 2024 11:20 Edited at: 7th Jun 2024 03:49
I'm trying to have an object that have shadows, with some form of of specularity, could be PBR, or Environment BumpMapping.
Environment BumpMapping seems to be a viable candidate, because it only use texture stage 0 and 1, so it probably won't conflict with ShadowMapping.
PBR objects seems to use texture stage 0, 1, 2, 3, 4, and 5, (for base, normal, roughness, metallic, AO, and skybox )
Directional Shadow/ShadowMapping use texture stage 2, 3, and 4 for its shadow map images.
But it seems that each object can only have 1 effects, applied by SetObjectEffect(objID,effect,tangent)
So is it really impossible to apply shadow + specularity at the same time?

Environment Bump-Mapping link: http://www.evolved-software.com/shadersnew/wenvironment
PBR link: http://www.evolved-software.com/shadersnew/wpbr
Directional shadow link: http://www.evolved-software.com/shadersnew/wshadowing
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 11th Jun 2024 22:01
@Scribble: it's not impossible just the way you need to implement AGK's shadow system would make some calculations redundant.
You need to inculde GetPSLighting which does shadows but also calculates the stuff vor lighting too so you'd end up with two different systems.
I guess you are better off when implementing your own shadow system as you then have full controll over it too.
Evolved already has all the different lighting calculations we just need to make the system for multiple lights around it directional shadows you can snatch from my shadow shader
Also that GetPSLighting problem is why i didn't do lighting or shadows in my shader pack as i wanted to fully support AGK's command set.
EVOLVED
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: unknown
Posted: 18th Jun 2024 22:44 Edited at: 3rd Jul 2024 00:04
@Scribble
I have reuploaded and updated the shaders samples today, DOFAGK.zip has been renamed to DOF_AGK.zip. Maybe it will work now, maybe it won't - but it's odd that it's getting flagged as a virus.

EDIT:

Now ported the tile rendering sample to AGK.

lighting system

Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 21st Jun 2024 04:48 Edited at: 21st Jun 2024 05:07
@EVOLVED
Thank you. The new DOF_AGK.zip can now be downloaded successfully. It was probably false-flagged because the website is http and not https, so the browsers just go super paranoid if it find a file name that's remotely similar to things that it has flagged before.
I hope you'll find success in combining/integrating the various shadow types and PBR.
An all-in-one integrated 'scene shader' that enables 3D scene to have shadows and lights that interacts with PBR/others will be a massive boon to AGK.
It will open doors to many wonderful 3D game world projects. Queue the song "I Can Show You the World" https://www.youtube.com/watch?v=PmvT7B3u7II
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 21st Jun 2024 09:34 Edited at: 22nd Jun 2024 16:34
@EVOLVED
Also, not sure if this is relevant to you, but just a heads-up in case you planned to use Render3d() command:
AGK has a RAM 'bug' with Render3D(). If Render3D() is called multiple times before Swap() and it's equivalents, it will incur massive permanent RAM usage that won't ever get cleared, even if no more Render3D() is called or all shaded objects and shaders are deleted, that will lasts until the .exe is closed.
Happens with Render() too.
DrawObject() doesn't seems to share this 'quirk', so they're good.
James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 6th Jul 2024 02:47
Quote: "Now ported the tile rendering sample to AGK."


Win 10 Home 64, Intel(R) Core(TM) i5-10300H, 8GB DDR4, NVidia GeForce GTX 1650 4GB GDDR6
GemGames
6
Years of Service
User Offline
Joined: 31st May 2018
Location: Edmonton, Alberta, Canada
Posted: 7th Jul 2024 16:03
I am new to shaders and their use, so please excuse my ignorance. My main question is:

Q1: Can shaders be used in 2d applications, or are they limited to only 3d applications?

After doing a little online research, I discovered that there is a such thing as 2d-applicable shaders named "pixel shaders", in contrast to 3d-applicable shaders named "vertex shaders". I suspect that the AppGameKit functions SetSpriteColor() and GetSpriteColor() are actually "pixel shaders" which are applied to the image (underlying 2d bitmap) of AppGameKit Sprites.

Q2: In order to use shaders in AppGameKit, is it necessary to use AGK's 3d commands/functions, or is it possible to use shaders while using only AGK's 2d commands/functions?

After viewing the description of the "Shader Pack" formerly available at https://store.steampowered.com/app/710830/AppGameKit_Classic__Shader_Pack/ it isn't clear to me whether or not these require the use of AGK's 3d commands for the shaders' use. I assume that some shaders (vertex shaders) would require the use of AGK's 3d commands, but possibly not all the shaders would require the use of AGK's 3d commands (specifically, pixel shaders would not, if any pixel shaders exist).

Q3: (I hope this question makes sense): Could 3d "vertex shaders" be applied to a 2d texture applied to a plane within a 3d rendered setting? If I understand correctly, this method could in effect apply a 3d shader to a 2d bitmap.

Thanks in advance for any help/clarification with these questions, and also thank you for making these shaders available for others' use, much appreciated.
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 19th Jul 2024 02:26 Edited at: 19th Jul 2024 02:30
@EVOLVED
This is perfect. The lighting system demo has almost everything a 3D scene needs; shadows that interacts with objects with customizable specular shininess and bumps, etc. A lot of people can get started fast with 3D scene using this.
For the future, I wonder how PBR would be implemented with shadows. I hope there will be no roadblocks.
Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 24th Jul 2024 19:12 Edited at: 24th Jul 2024 19:17
Cubemapping + SkyBox



Needs some tinkering for edge alignment, as it's being done in a "quick and simple" approach rather than accurate but a good base.
Cube Mapping (something absent from AGK) is useful for more than just fake reflections, but other things, such-as light and shadow projection depending on how you want to use it.

This is more of a template to add to OTHER Shaders (and I used Texture Stage 7 specifically for that reason).

Cubemap Pixel Shader


Cubemap Vertex Shader


Program








Attachments

Login to view attachments
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 25th Jul 2024 17:18
How would we use this for environment? we need 6 renders from the current camera angle im guessing we could update the images every few seconds perhaps where the char moves through the enviroment but it would eat into a frame rate unless we spaced the renders out perhaps based on the sync rate? the 6 images would be slightly off from play pos depending on speed but prolly decent enough for most games?

janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 1st Aug 2024 17:10 Edited at: 1st Aug 2024 17:29
@Smerf there is a technique called parralax correction i demonstrated 3 years ago, which corrects for the camera offset to the bounding box of the environment map and only needs to be renderd once.

I made a function for my shader pack and started a specular uber shader that can handle realtime reflections for every object in a scene, static and dynamic ones, as you only need to render the environment map once for the specific area and interpolate between those env. maps.
And I want to share it here as I probably won't be able to do something with it any time soon:

This works with any environment map as it just returns the corrected normal.
I had the ability to shoot a ton of small balls with physics enabled which also had reflections using only this one environment map that was rendered once at the beginning but i didn't show it in the video.
I played with blending between two of those parallax corrected env. maps using SDF's, as I didn't want to use 3 environment maps and use baricentric coordinates.
Also i think Rotating the bounding box never worked for me.
Maybe Evolved can implement paralax correction into his great library.
Map Scape 3 would probably be a great tool to position those bounding boxes for the env. maps ect. but it states that it is discontinued
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 10th Oct 2024 13:34 Edited at: 14th Oct 2024 04:37
Hello everybody. There's something I'm confused about regarding EVOLVED's Tile Rendering demo textures that was posted above.
Regarding textures that we apply on various objects in the scene, more specifically the stage 1 (normal) , and 2(specular),
What format does the nomal and specular maps use?
I'm guessing the normal map is using DuDv map (http://wiki.polycount.com/wiki/DuDv_map), that's why it's green-red instead of the usual blue-green. But I'm not sure. What exactly does the alpha,red and green used for?
Same issue about the specular map. It's green-red+alpha instead of the usual black/white. I'm guessing the green channel is for Parallax mapping, but what does the alpha and red channel used for? SSAO? Intensity?

So,
Normal map:
Red: Up?
Green: Down?
Blue: Not used
Alpha: ????

Specular map:
Red: ???specular/intensity/SSAO???
Green: Parallax
Blue: Not used
Alpha: ???specular/Intensity/SSAO???

Can somebody clarify the function of the channels of the Specular and Normal texture use in that demo?
I've attached the texture below.
Thanks in advance.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-17 22:15:19
Your offset time is: 2024-11-17 22:15:19