OSP Shaders Tama's Shaders (Dynamic Parallax Occlusion & Parallax & SSAO)

Users who are viewing this thread

_Sebastian_ said:
A while back I've posted a fast SSAO code which is OSP aswell.
You might check it out;
_Sebastian_ said:
Heyho.
Since La Grandmaster and some other guys asked me how I achieved the SSAO effect, it would be a shame to not share it's basic code...
But since all of my shaders and the structure itself is rewritten from scratch, it's not that easy to apply the effect to your mod.
Due to that your HLSL experience is key to get it working and not to mess everything up.

So let's get started.
I actually use the postFX_sampler1(used for HDR) which is rendered in half-(low hdr) or quarter-(high hdr) resolution anyway and bake the SSAO to it's alpha channel.
After that I blur the sampler based on depth difference by using the ps_main_blur(X/Y) and then pass it to the shaders file, but you also can apply it to the final PostFX pass ofc.

The code is not well documented(I'm lazy ikr) and the SSAO only works in combination with HDR(I recommend low hdr cause of the half res sampler) and enabled Depth Effects.

Make sure you can access the depth buffer.
Code:
#if defined(USE_FX_STATE_MANAGER) && !defined(USE_DEVICE_TEXTURE_ASSIGN)	//else we can use direct device access with sampler indexes...
	texture postFX_texture0, postFX_texture1, postFX_texture2, postFX_texture3, postFX_texture4;
	//non-srgb samplers
	sampler postFX_sampler0 : register(s0) = sampler_state	{  Texture = postFX_texture0;  };  // scene
	sampler postFX_sampler1 : register(s1) = sampler_state	{  Texture = postFX_texture1;  };  // hdr-low = 1/2res high = 1/4res
	sampler postFX_sampler2 : register(s2) = sampler_state	{  Texture = postFX_texture2;  };  // brightness .. AVG and MAX
	sampler postFX_sampler3 : register(s3) = sampler_state	{  Texture = postFX_texture3;  };  // black
	sampler postFX_sampler4 : register(s4) = sampler_state	{  Texture = postFX_texture4;  };  // == sampler 2 + WithLuminance???
	sampler postFX_sampler5 : register(s5);// depth
	// sampler postFX_sampler6 : register(s6);// cubic  ...black screen
	// sampler postFX_sampler7 : register(s7);// shadowmap ...white screen
	// sampler postFX_sampler8 : register(s8);// screen ...half resolution screen
	// sampler postFX_sampler9 : register(s9);// mesh ...shows random texture
	// sampler postFX_sampler10 : register(s10);// clamped ...black screen
	// sampler postFX_sampler11 : register(s11);// font ...shows font texture
	// sampler postFX_sampler12 : register(s12);// char shadow ...black screen
	// sampler postFX_sampler13 : register(s13);// mesh no filter ...shows random texture without filter
	// sampler postFX_sampler14 : register(s14);// diffuse no wrap ...black screen
	// sampler postFX_sampler15 : register(s15);// grass ...black screen
	
	// sampler postFX_sampler16 : register(s0);//reflection ...shows blurry screen
	// sampler postFX_sampler17 : register(s1);//env ...shows env texture
	// sampler postFX_sampler18 : register(s2);//diffuse ...shows random diffuse texture
	// sampler postFX_sampler19 : register(s3);//normal ...shows random normal texture
#else 
	#ifdef USE_REGISTERED_SAMPLERS
		sampler postFX_sampler0 : register(s0);	//linear clamp
		sampler postFX_sampler1 : register(s1);	//linear clamp
		sampler postFX_sampler2 : register(s2);	//linear clamp
		sampler postFX_sampler3 : register(s3);	//linear clamp
		sampler postFX_sampler4 : register(s4);	//linear clamp
	#else
		sampler postFX_sampler0 : register(s0) = sampler_state{ AddressU = CLAMP; AddressV = CLAMP; MinFilter = LINEAR; MagFilter = LINEAR;	 };	//linear clamp
		sampler postFX_sampler1 : register(s1) = sampler_state{ AddressU = CLAMP; AddressV = CLAMP; MinFilter = LINEAR; MagFilter = LINEAR;	 };	//linear clamp
		sampler postFX_sampler2 : register(s2) = sampler_state{ AddressU = CLAMP; AddressV = CLAMP; MinFilter = LINEAR; MagFilter = LINEAR;	 };	//linear clamp
		sampler postFX_sampler3 : register(s3) = sampler_state{ AddressU = CLAMP; AddressV = CLAMP; MinFilter = LINEAR; MagFilter = LINEAR;	 };	//linear clamp
		sampler postFX_sampler4 : register(s4) = sampler_state{ AddressU = CLAMP; AddressV = CLAMP; MinFilter = LINEAR; MagFilter = LINEAR;	 };	//linear clamp
	#endif
#endif

Set up the static constants.
Code:
static const int clip_distance = 1250;// is 1250 by default you can change it in module.ini ...=> far_plane_distance = 1250 #clip distance
static const int num_iterations = 8;
static const float BlurPixelWeight[num_iterations] = {1.000, 0.875, 0.750, 0.625, 0.500, 0.375, 0.250, 0.125};

Render the SSAO and bake it to the sampler's alpha channel.
Code:
float4 ps_main_brightPass(float2 texCoord: TEXCOORD0 ) : COLOR0 
{
	float3 color = tex2D(postFX_sampler0, texCoord);
	color *= 255.0f; //make it real values.. more accuracy
	color = pow(color, 2.0f);
	
	//SSAO
	float occlusion = 0.0f;
 	float base_depth = tex2D(postFX_sampler5, texCoord).r;
	if (base_depth < 1.0f)//1 = clip_distance
	{
		base_depth *= clip_distance;
		
		float2 normal;//now generate pseudo random values
		normal.x = frac(sin((texCoord.x + 0.5) * (texCoord.y + 0.5) * 1000.0f) * 1000.0f);
		normal.y = frac(cos((texCoord.x + 0.5) * (texCoord.y + 0.5) * 1000.0f) * 1000.0f);
		normal *= 2.0f;
		normal -= 1.0f;
		float2 offset = g_HalfPixel_ViewportSizeInv.zw * normal * 250.0f / base_depth;
		
		float2 cur_offset;
		float difference_1, difference_2, check_dist;
		for(int i = 1; i <= 4; i++)
		{
			check_dist = i;
			cur_offset = offset * i;
			difference_1 = base_depth - tex2D(postFX_sampler5, texCoord + cur_offset).r * clip_distance;
			difference_2 = base_depth - tex2D(postFX_sampler5, texCoord - cur_offset).r * clip_distance;
			// if one sample distance is invalid then use its twins inverse ... almost completely removes haloing
			if (difference_1 > check_dist && difference_2 < check_dist)
				difference_1 = -difference_2;
			else if (difference_2 > check_dist && difference_1 < check_dist)
				difference_2 = -difference_1;
			difference_1 = saturate(difference_1 / check_dist);
			difference_2 = saturate(difference_2 / check_dist);
			occlusion += saturate((difference_1 * (1.0f - difference_1) + difference_2 * (1.0f - difference_2)) - 0.25);
		}
		occlusion *= 2.0f;
	}
	return float4(color, saturate(occlusion));
}

Blur the sampler.
Code:
float4 ps_main_blurX(float2 inTex: TEXCOORD0) : COLOR0 
{
	float4 total_color = tex2D(postFX_sampler0, inTex) * BlurPixelWeight[0];
	float4 cur_color;
	float2 offset = float2(g_HalfPixel_ViewportSizeInv.z, 0);
	float2 cur_offset;
	float base_depth = tex2D(postFX_sampler5, inTex).r * clip_distance * 10.0f;
	float cur_amount;
	float2 blur_amount = 1.0f;
	for(int i = 1; i < num_iterations; i++)
	{
		for(int j = 0; j < 2; j++)
		{
			if(j == 0)
				cur_offset = inTex + offset * i;
			else
				cur_offset = inTex - offset * i;
			cur_color = tex2D(postFX_sampler0, cur_offset) * BlurPixelWeight[i];
			cur_amount = max(1.0f / i, 1.0f - abs(base_depth - tex2D(postFX_sampler5, cur_offset).r * clip_distance * 10.0f));//based on difference
			total_color.a += cur_color.a * cur_amount;
			total_color.rgb += cur_color.rgb;
			blur_amount.x += BlurPixelWeight[i];
			blur_amount.y += BlurPixelWeight[i] * cur_amount;
		}
	}
	total_color.rgb /= blur_amount.x;
	total_color.a /= blur_amount.y;
	return total_color;
}
float4 ps_main_blurY(float2 inTex: TEXCOORD0) : COLOR0 
{
	float4 total_color = tex2D(postFX_sampler0, inTex) * BlurPixelWeight[0];
	float4 cur_color;
	float2 offset = float2(0, g_HalfPixel_ViewportSizeInv.w);
	float2 cur_offset;
	float base_depth = tex2D(postFX_sampler5, inTex).r * clip_distance * 10.0f;
	float cur_amount;
	float2 blur_amount = 1.0f;
	for(int i = 1; i < num_iterations; i++)
	{
		for(int j = 0; j < 2; j++)
		{
			if(j == 0)
				cur_offset = inTex + offset * i;
			else
				cur_offset = inTex - offset * i;
			cur_color = tex2D(postFX_sampler0, cur_offset) * BlurPixelWeight[i];
			cur_amount = max(1.0f / i, 1.0f - abs(base_depth - tex2D(postFX_sampler5, cur_offset).r * clip_distance * 10.0f));//based on difference
			total_color.a += cur_color.a * cur_amount;
			total_color.rgb += cur_color.rgb;
			blur_amount.x += BlurPixelWeight[i];
			blur_amount.y += BlurPixelWeight[i] * cur_amount;
		}
	}
	total_color.rgb /= blur_amount.x;
	total_color.a /= blur_amount.y;
	return total_color;
}

Now you either can apply the SSAO to the final pass FinalScenePassPS and use it as pure PostFX effect...
Code:
	// return 1.0f - tex2D(postFX_sampler1, texCoord).a;//SSAO only
	return lerp(color, 0.0f, tex2D(postFX_sampler1, texCoord).a);

...or pass it to the shaders file and apply the SSAO to any shader in order to avoid some issues;
_Sebastian_ said:
The shader is actually a PostFX shader, but applied to a PostFX sampler that is passed to the shaders file.
So you can use it on every pixel shader you like, or not...
This way you're able to avoid occlusion artifacts on surfaces with manipulated vertices or materials that are not affected by the depth buffer, eg. particles, water, fog etc.

And here starts the tricky part...
You have to replace the ENV sampler with the specific PostFX sampler, cause all 16 samplers are already used.
So you wont be able to use fake reflections by using env textures anymore... but I dont mind since I use screen space reflections instead.
Code:
// Texture&Samplers
texture postFX_texture1;

#if defined(USE_SHARED_DIFFUSE_MAP) || !defined(USE_DEVICE_TEXTURE_ASSIGN)
	texture diffuse_texture;
#endif

#ifndef USE_DEVICE_TEXTURE_ASSIGN
	texture diffuse_texture_2;
	texture specular_texture;
	texture normal_texture;
	texture env_texture;
	texture shadowmap_texture;

	texture cubic_texture;

	texture depth_texture;
	texture screen_texture;

	#ifdef USE_REGISTERED_SAMPLERS
	sampler ReflectionTextureSampler 	: register(fx_ReflectionTextureSampler_RegisterS 		) = sampler_state	{  Texture = env_texture;		};
	sampler PostFXTextureSampler			: register(fx_EnvTextureSampler_RegisterS				) = sampler_state	{  Texture = postFX_texture1;		};
	sampler Diffuse2Sampler 			: register(fx_Diffuse2Sampler_RegisterS 				) = sampler_state	{  Texture = diffuse_texture_2;	};
	sampler NormalTextureSampler		: register(fx_NormalTextureSampler_RegisterS			) = sampler_state	{  Texture = normal_texture;	};
	sampler SpecularTextureSampler 		: register(fx_SpecularTextureSampler_RegisterS 			) = sampler_state	{  Texture = specular_texture;	};
	sampler DepthTextureSampler 		: register(fx_DepthTextureSampler_RegisterS 			) = sampler_state	{  Texture = depth_texture;	    };
	sampler CubicTextureSampler 		: register(fx_CubicTextureSampler_RegisterS 			) = sampler_state	{  Texture = cubic_texture;	    };
	sampler ShadowmapTextureSampler 	: register(fx_ShadowmapTextureSampler_RegisterS 		) = sampler_state	{  Texture = shadowmap_texture;	};
	sampler ScreenTextureSampler 		: register(fx_ScreenTextureSampler_RegisterS			) = sampler_state	{  Texture = screen_texture;	};
	sampler MeshTextureSampler 			: register(fx_MeshTextureSampler_RegisterS 				) = sampler_state	{  Texture = diffuse_texture;	};
	sampler ClampedTextureSampler 		: register(fx_ClampedTextureSampler_RegisterS 			) = sampler_state	{  Texture = diffuse_texture;	};
	sampler FontTextureSampler 			: register(fx_FontTextureSampler_RegisterS 				) = sampler_state	{  Texture = diffuse_texture;	};
	sampler CharacterShadowTextureSampler:register(fx_CharacterShadowTextureSampler_RegisterS	) = sampler_state	{  Texture = diffuse_texture;	};
	sampler MeshTextureSamplerNoFilter 	: register(fx_MeshTextureSamplerNoFilter_RegisterS 		) = sampler_state	{  Texture = diffuse_texture;	};
	sampler DiffuseTextureSamplerNoWrap : register(fx_DiffuseTextureSamplerNoWrap_RegisterS 	) = sampler_state	{  Texture = diffuse_texture;	};
	sampler GrassTextureSampler 		: register(fx_GrassTextureSampler_RegisterS 			) = sampler_state	{  Texture = diffuse_texture;	};
	#else


	sampler ReflectionTextureSampler 	= sampler_state	{  Texture = env_texture;		AddressU = CLAMP; AddressV = CLAMP; MinFilter = LINEAR; MagFilter = LINEAR;	};
	sampler PostFXTextureSampler			= sampler_state	{  Texture = postFX_texture1;		AddressU = WRAP;  AddressV = WRAP;  MinFilter = LINEAR; MagFilter = LINEAR;	};
	sampler Diffuse2Sampler 			= sampler_state	{  Texture = diffuse_texture_2;	AddressU = WRAP; AddressV = WRAP; MinFilter = LINEAR; MagFilter = LINEAR;	};
	sampler NormalTextureSampler		= sampler_state	{  Texture = normal_texture;	AddressU = WRAP; AddressV = WRAP; MinFilter = LINEAR; MagFilter = LINEAR;	};
	sampler SpecularTextureSampler 		= sampler_state	{  Texture = specular_texture;	AddressU = WRAP; AddressV = WRAP; MinFilter = LINEAR; MagFilter = LINEAR;	};
	sampler DepthTextureSampler 		= sampler_state	{  Texture = depth_texture;		AddressU = CLAMP; AddressV = CLAMP; MinFilter = LINEAR; MagFilter = LINEAR;    };
	sampler CubicTextureSampler 		= sampler_state	{  Texture = cubic_texture;	 	AddressU = CLAMP; AddressV = CLAMP; MinFilter = LINEAR; MagFilter = LINEAR;   };
	sampler ShadowmapTextureSampler 	= sampler_state	{  Texture = shadowmap_texture;	AddressU = CLAMP; AddressV = CLAMP; MinFilter = LINEAR; MagFilter = LINEAR;	};
	sampler ScreenTextureSampler 		= sampler_state	{  Texture = screen_texture;	AddressU = CLAMP; AddressV = CLAMP; MinFilter = LINEAR; MagFilter = LINEAR;	};
	sampler MeshTextureSampler 			= sampler_state	{  Texture = diffuse_texture;	AddressU = WRAP; AddressV = WRAP; MinFilter = LINEAR; MagFilter = LINEAR;	};
	sampler ClampedTextureSampler 		= sampler_state	{  Texture = diffuse_texture;	AddressU = CLAMP; AddressV = CLAMP; MinFilter = LINEAR; MagFilter = LINEAR;	};
	sampler FontTextureSampler 			= sampler_state	{  Texture = diffuse_texture;	AddressU = WRAP; AddressV = WRAP; MinFilter = LINEAR; MagFilter = LINEAR;	};
	sampler CharacterShadowTextureSampler= sampler_state	{  Texture = diffuse_texture;	AddressU = BORDER; AddressV = BORDER; MinFilter = LINEAR; MagFilter = LINEAR;	};
	sampler MeshTextureSamplerNoFilter 	= sampler_state	{  Texture = diffuse_texture;	AddressU = WRAP; AddressV = WRAP; MinFilter = NONE; MagFilter = NONE;	};
	sampler DiffuseTextureSamplerNoWrap = sampler_state	{  Texture = diffuse_texture;	AddressU = CLAMP; AddressV = CLAMP; MinFilter = LINEAR; MagFilter = LINEAR;	};
	sampler GrassTextureSampler 		= sampler_state	{  Texture = diffuse_texture;	AddressU = CLAMP; AddressV = CLAMP; MinFilter = LINEAR; MagFilter = LINEAR;	};

	#endif

#else
	sampler ReflectionTextureSampler 	: register(fx_ReflectionTextureSampler_RegisterS 		);
	sampler PostFXTextureSampler			: register(fx_EnvTextureSampler_RegisterS				);
	sampler Diffuse2Sampler 			: register(fx_Diffuse2Sampler_RegisterS 				);
	sampler NormalTextureSampler		: register(fx_NormalTextureSampler_RegisterS			);
	sampler SpecularTextureSampler 		: register(fx_SpecularTextureSampler_RegisterS 			);
	sampler DepthTextureSampler 		: register(fx_DepthTextureSampler_RegisterS 			);
	sampler CubicTextureSampler 		: register(fx_CubicTextureSampler_RegisterS 			);
	sampler ShadowmapTextureSampler 	: register(fx_ShadowmapTextureSampler_RegisterS 		);
	sampler ScreenTextureSampler 		: register(fx_ScreenTextureSampler_RegisterS			);

	#ifdef USE_SHARED_DIFFUSE_MAP
		sampler MeshTextureSampler 			: register(fx_MeshTextureSampler_RegisterS 				) = sampler_state	{  Texture = diffuse_texture;	};
		sampler ClampedTextureSampler 		: register(fx_ClampedTextureSampler_RegisterS 			) = sampler_state	{  Texture = diffuse_texture;	};
		sampler FontTextureSampler 			: register(fx_FontTextureSampler_RegisterS 				) = sampler_state	{  Texture = diffuse_texture;	};
		sampler CharacterShadowTextureSampler:register(fx_CharacterShadowTextureSampler_RegisterS	) = sampler_state	{  Texture = diffuse_texture;	};
		sampler MeshTextureSamplerNoFilter 	: register(fx_MeshTextureSamplerNoFilter_RegisterS 		) = sampler_state	{  Texture = diffuse_texture;	};
		sampler DiffuseTextureSamplerNoWrap : register(fx_DiffuseTextureSamplerNoWrap_RegisterS 	) = sampler_state	{  Texture = diffuse_texture;	};
		sampler GrassTextureSampler 		: register(fx_GrassTextureSampler_RegisterS 			) = sampler_state	{  Texture = diffuse_texture;	};
	#else
		sampler MeshTextureSampler 			: register(fx_MeshTextureSampler_RegisterS 				);
		sampler ClampedTextureSampler 		: register(fx_ClampedTextureSampler_RegisterS 			);
		sampler FontTextureSampler 			: register(fx_FontTextureSampler_RegisterS 				);
		sampler CharacterShadowTextureSampler:register(fx_CharacterShadowTextureSampler_RegisterS	);
		sampler MeshTextureSamplerNoFilter 	: register(fx_MeshTextureSamplerNoFilter_RegisterS 		);
		sampler DiffuseTextureSamplerNoWrap : register(fx_DiffuseTextureSamplerNoWrap_RegisterS 	);
		sampler GrassTextureSampler 		: register(fx_GrassTextureSampler_RegisterS 			);
	#endif
#endif

In order to apply the SSAO to a specific shader you first need to get the screen space position within the vertex shader.
Code:
	if(use_depth_effects)
	{
		Out.projCoord.xy = (float2(Out.Pos.x, -Out.Pos.y)+Out.Pos.w)/2.0f;
		Out.projCoord.xy += (vDepthRT_HalfPixel_ViewportSizeInv.xy * Out.Pos.w);
		Out.projCoord.zw = Out.Pos.zw;
	}

And then apply the SSAO to the ambient term of the pixel shader.
Code:
	if(use_depth_effects)
	{
		float4 ssao = tex2Dproj(PostFXTextureSampler, In.projCoord);
		if ((ssao.r + ssao.g + ssao.b) > 0.0f)//check if HDR is enabled
			ambient_term *= 1.0f - ssao.a;
	}

You can use this code to create your own SSAO effect, but dont forget to give me credit.  :wink:

I've seen your code and tried it as well. But I liked the results of Yoshiboy's ssao much more.



SSAO Comparison. First Image with ssao, second image without ssao.
GVowQ5I.jpg

Tv3GI3L.jpg

M4axKR7.jpg

Iogo3zy.jpg

CGr9c93.jpg

c47fKya.jpg
Other Screenshots:
wBOO8LM.jpg

N90C9gH.jpg

mdQ3zdU.jpg

jQSbdIy.jpg
 
HarryPham123 said:
yeah i have seen those pics about SSAO that you have uploaded but can you tell me more detail about SSAO  :???:

Basically SSAO - Screen Space Ambient Occlusion simulates occlusion of ambient light. Which means making places shielded from light to appear darker instead of everything in screen having the same light intensity. But it isn't a perfect simulation, but good enough for video games. For more info on the subject check out the wiki page: https://en.wikipedia.org/wiki/Screen_space_ambient_occlusion and check out comparison photos on bing/google. :smile:
 
Hello Tama thanks for your osp! can I ask you if you're able to do something like this? http://www.mbmerc.com/?q=graphics&slide=5
I don't know if the improved normal's calculation is the same as yours but the improved lighting and the new metal shader are really good, maybe you could ask the author if he want to share his stuff.
 
HarryPham123 said:
So about the SSAO i see it missing standart_shader_bumpparallax_nospec_high_noterraincolor
First Post said:
To see all the available shader types available in this Kit, open Core_Shaders.brf inside the Resource folder. Each shader with _parallax prefix at the end or somewhere in the middle requires a normalmap texture with a heightmap placed in it's blue channel. The shader names are usually the same with their native counterparts which doesn't have parallax. The aforementioned shaders are also set as fallback's. But parallax is a simple technique and I don't think the fallbacks are necessary, but better to be safe than sorry.


fedeita said:
Hello Tama thanks for your osp! can I ask you if you're able to do something like this? http://www.mbmerc.com/?q=graphics&slide=5
I don't know if the improved normal's calculation is the same as yours but the improved lighting and the new metal shader are really good, maybe you could ask the author if he want to share his stuff.
Thanks fedeita! I really appretiate it. Adding reflection on armors should be fairly easy. But changing the lighting model, that could take a bit of my time.

Well that said, I didn't like the new lighting in those screenshots. But I don't want to criticize in a random topic of my own where they can't ever see it :razz:
 
hey man i have a problem the rlg_log said attempt to reregister shader standart_shader_bump_nospec_high_noterraincolor_parallax->new shader will be ignored what the it meant  :???:
 
HarryPham123 said:
hey man i have a problem the rlg_log said attempt to reregister shader standart_shader_bump_nospec_high_noterraincolor_parallax->new shader will be ignored what the it meant  :???:

I think it's pretty clear. But what I don't know is what you did. Unless you tell me what steps you took until you arriveth at this message, I cannot help you :smile:
 
well  i downloaded your osp and i added in my mod but when i opened my mod and it show some error like this http://imgur.com/a/nxpFe
wat it really meant new shader will be ignored .And i have done your guide
 
HarryPham123 said:
well  i downloaded your osp and i added in my mod but when i opened my mod and it show some error like this http://imgur.com/a/nxpFe
wat it really meant new shader will be ignored .And i have done your guide

Please recheck the instructions related with the parallax_materials.brf and core_shaders.brf That is the only thing i can think of. If you followed those instructions correctly then i have no idea what could be wrong.
 
Hi guys. I don't know if anybody is still following this topic but recently I felt like playing warband again and the simple parallax shader wasn't cutting it. So I made this:

These are very early WIP screenshots of Dynamic Parallax Occlusion implementation with self-shadowing, mipmaps and lods.

hWgdHp7.jpg

3g4RI45.jpg

wqMYbK5.jpg

zZiAaV7.jpg

i1H13v4.jpg

3Lvfua9.jpg

3LZMAhJ.jpg

It looks like a blob of blob in extreme angles (when close to 0 degrees). I'm currently working on interpolating those situations to normalmap to get rid of it.

And to make it all work I had to switch the Pixel Shader 3.0. Which made some problems in the map view. The Map view is a complete cluster**** of colors atm.

And the new parallax occlusion only works outdoors(excluding terrain). So I still have to make indoor version and multiple terrain versions for single texture and multitexture.

And I need to implement a way to pass parameters from the material to shader. So different looks can be achieved with different materials/textures. Currently these parameters are static constant variables in the shader.

As before the heightmap is stored in the blue channel of the normalmap and z component of normalmap is calculated on the go.

There is a lot to fix, optimize, and add. So I won't be releasing just yet. But keep an eye on the topic incase I suddenly finish it and share a link.

Have no doubt that I will release it as a native ready package along with the source.
 
Warbandda P.S Shader 3.0 destegi olduguna eminmisin? Eski konularda okudugumu hatirliyorum sorunlari var diye.
 
Let me translate that for other people...
Efe Karacar said:
Are you sure warband supports P.S. 3.0? I remember reading that it had some problems.

The only problem I saw was on the map. Transparent textures and lots of reflections. I'm sure it's nothing that cannot be fixed.

Some More Screenshots of the Dynamic Parallax Occlusion in Veluca. (only walls)

Xff4Hag.jpg

9HwAlsl.jpg

I have to say that I'm very satisfied with how it looks. There is still some tweaks need to be done in order to make it more user friendly for designers.

I decided not to make an indoor version of the Dynamic Parallax Occlusion, since the simple version looks ok indoors to me. Plus it's around 50-200 fold more easy on the gpu. Here are some screenshots of the Simple Parallax width depth shading:

6oljLVH.jpg

KW3txx2.jpg
 
I've managed to compile only the Dynamic Parallax Occlusion using vs_3_0 and ps_3_0. And reverted everything else back to vs_2_a and ps_2_x. Now everything seems to work well. Now all I need is to make the terrain version of the shader, and passing parameters to shader from the material. Then I will release.
 
Back
Top Bottom