pp_set/add setting obscure screen size

Posted By: Stansmedia

pp_set/add setting obscure screen size - 06/08/14 20:58

I'm trying to load up the HDR shader and blur shader, but the game window ends up being a small box in the top left. Is there a specific way to call post processing shaders? Like before/after level load with a wait call or something? It was fine before, but now I've added a level loading function so I can call it with a number, have all my variables reset or change yadayada, it went all weird.
Posted By: Stansmedia

Re: pp_set/add setting obscure screen size - 06/11/14 16:42

I guess while I got a thread open...

Is it normal for mirror planes and water reflections to mirror the view at a higher inverted z? Like, if something was halfway in the water, and the reflection didn't match up with the model. Is that normal? Or can this be fixed.
Posted By: Stansmedia

Re: pp_set/add setting obscure screen size - 06/11/14 18:39

portalclip - noshader/noparticle... Somebody grab a sock and a bar of soap.

Theres no way to use portalclip and have shaders reflect? :'(
Posted By: Superku

Re: pp_set/add setting obscure screen size - 06/11/14 19:04

Originally Posted By: Stansmedia
Is it normal for mirror planes and water reflections to mirror the view at a higher inverted z? Like, if something was halfway in the water, and the reflection didn't match up with the model. Is that normal? Or can this be fixed.

This sounds like your reflection view z or the waterheight is not set correctly.

Just don't set NOSHADER for the reflection view, it's stupid that this flag is there anyway.
Posted By: Stansmedia

Re: pp_set/add setting obscure screen size - 06/11/14 23:46

The odd matched z is from portalclip not being set, and noshader only works with portal clip set. So I'm stuck with two options: reflect shaders, but show z clipping "artificat", or render it properly but without shaders.

The "cut scene" im using this for is probably going to raise some red flags sooo. It would be cool if there is a way. Really cool. Raise those flag higher.
Posted By: Superku

Re: pp_set/add setting obscure screen size - 06/12/14 08:35

Option three: Create a copy of each material/ shader that has an object which penetrates the water surface. Then add something like
clip(inPos.y-waterheight_var);
in your pixel shader of said materials and preferably only use those materials in the reflection view (ENABLE_TREE and similar flags plus material events and render_view).
Posted By: Stansmedia

Re: pp_set/add setting obscure screen size - 06/14/14 03:11

Where should I slip the clip(..) into the shader code?

Code:
//////////////////////////////////////////////////////////////////////
// Blinn / Phong bump mapping
// (c) oP group 2010  Version 2.3
//////////////////////////////////////////////////////////////////////

#include <bump_vs>
#include <phong>

bool REQUIRE_NORMAL;

texture entSkin1;	// texture
texture entSkin2;	// normal map or lightmap
texture entSkin3;	// normal map on blocks

sampler sBaseTex = sampler_state { Texture = <entSkin1>; MipFilter = Linear;	};
sampler sSkin2 = sampler_state { Texture = <entSkin2>; MipFilter = None;	};
sampler sSkin3 = sampler_state { Texture = <entSkin3>; MipFilter = None;	};

float3 DoSpecular(bumpOut In,float3 Normal,float fSpecular)
{
#ifdef BLINN
	float3 viewDir = -normalize(In.ViewDir);	
			
	float fLight = dot(In.LightDir1.xyz,Normal);
	float3 R = reflect(In.LightDir1.xyz,Normal);
	float3 Diffuse = DoPhong(In.Diffuse1,fLight,dot(R,viewDir),fSpecular);
	fLight = dot(In.LightDir2.xyz,Normal);
	R = reflect(In.LightDir2.xyz,Normal);
	Diffuse += DoPhong(In.Diffuse2,fLight,dot(R,viewDir),fSpecular);

	fLight = dot(In.LightDir3.xyz,Normal);
	R = reflect(In.LightDir3.xyz,Normal);
	Diffuse += DoPhong(In.Diffuse3,fLight,dot(R,viewDir),fSpecular);
	
#else // PHONG			
	float fLight = dot(In.LightDir1.xyz,Normal);
	float3 Diffuse = DoPhong(In.Diffuse1,fLight,fLight,fSpecular);		

	fLight = dot(In.LightDir2.xyz,Normal);
	Diffuse += DoPhong(In.Diffuse2,fLight,fLight,fSpecular);		

	fLight = dot(In.LightDir3.xyz,Normal);
	Diffuse += DoPhong(In.Diffuse3,fLight,fLight,fSpecular);
#endif

	return Diffuse;
}

float4 specBump_PS(bumpOut In): COLOR
{
	float4 Base = tex2D(sBaseTex,In.Tex12.xy);
	float3 Normalmap = tex2D(sSkin2,In.Tex12.xy)*2-1;
  float3 Diffuse = DoSpecular(In,Normalmap,Base.w);	
	return Base * DoColor(Diffuse,In.Ambient);
}

float4 specBumpLM_PS(bumpOut In): COLOR
{
	float4 Base = tex2D(sBaseTex,In.Tex12.xy);
	float4 Lightmap = tex2D(sSkin2,In.Tex12.zw);
	float3 Normalmap = tex2D(sSkin3,In.Tex12.xy)*2-1;
  float3 Diffuse = DoSpecular(In,Normalmap,Base.w);	
	return Base * DoLightmap(Diffuse,Lightmap,In.Ambient);
}


technique spec
{
	pass one
	{	
      ZWriteEnable = True;
      AlphaBlendEnable = False;

		VertexShader = compile vs_2_0 bump_VS();
		PixelShader = compile ps_2_0 specBump_PS();
	}
}

technique spec_lm
{
	pass one
	{		
		ZWriteEnable = True;
		AlphaBlendEnable = False;
		
		VertexShader = compile vs_2_0 bump_VS();
		PixelShader = compile ps_2_0 specBumpLM_PS();
	}
}

technique fallback { pass one { } }

Posted By: Stansmedia

Re: pp_set/add setting obscure screen size - 06/14/14 04:37

Im looking at the enable_tree and render_view stuff in the manual. I have no idea what I'm doing. I can't figure out how to get each shader to render only on a specific view. Maybe im just tired (easy excuse). If you got time superku please help. if not I wont be heartbroken.
Posted By: Superku

Re: pp_set/add setting obscure screen size - 06/14/14 09:50

I'm not too familiar with the default engine shaders so changing and adapting them would probably mean more work than just writing a new normal mapping shader.
I suggest you simply take the normal mapping shader from the online shader tutorial and adapt it as follows:

1) In your vertex shader you will need to OUTput the y world position of the vertex, for instance make OutTex a float3 instead of float2 and write
OutTex.z = mul(inPos,matWorld).y;

2) Your pixel shader will now need to import float3 as inTex, too, then simply write the following line at the beginning of the pixel shader function:
clip(inTex.z-water_height_var);

3) Define var water_height = 123; in your script and write float water_height_var; at the beginning of your shader file.

4) Material events can be utilized as follows:

var mat_my_bump_switch_event()
{
if(render_view == camera) mtl = mat_my_bump;
else mtl = mat_my_bump_clip;
return 0;
}

MATERIAL* mat_my_bump = {...}
MATERIAL* mat_my_bump_clip = {nm shader with clip code}
MATERIAL* mat_my_bump_switch =
{
event = mat_my_bump_switch_event;
flags = ENABLE_RENDER;
}

Now apply the mat_my_bump_switch material to your entities which can penetrate the water surface.
Posted By: Stansmedia

Re: pp_set/add setting obscure screen size - 06/14/14 16:18

Thank you. Being able to switch the material in the view has made this a lot frickin creepier. But it is not clipping at the water plane :'(



Code:
// Tweakables: 
static const float AmbientIntensity  = 1.0f; // The intensity of the ambient light. 
static const float DiffuseIntensity = 1.0f;  // The intensity of the diffuse light. 
static const float SpecularIntensity = 1.0f; // The intensity of the specular light. 
static const float SpecularPower = 8.0f;     // The specular power. Used as 'glossyness' factor. 
static const float4 SunColor = {0.9f, 0.9f, 0.5f, 1.0f}; // Color vector of the sunlight. 

float water_height_var;
  
// Application fed data: 
const float4x4 matWorldViewProj; // World*view*projection matrix. 
const float4x4 matWorld; // World matrix. 
const float4 vecAmbient; // Ambient color. 
const float4 vecSunDir;  // Sun light direction vector. 
const float4 vecViewPos; // View position. 
    
float3x3 matTangent; // hint for the engine to create tangents in TEXCOORD2

texture mtlSkin1; 
sampler ColorMapSampler = sampler_state  // Color map sampler. 
{ 
   Texture = <mtlSkin1>; 
   MipFilter = Linear;   // required for mipmapping
}; 
    
texture mtlSkin2;  // Normal map. 
sampler NormalMapSampler = sampler_state  // Normal map sampler. 
{ 
   Texture = <mtlSkin2>; 
   MipFilter = None;   // a normal map usually has no mipmaps
}; 

// Vertex Shader: 
void NormalMapVS( in float4 InPos: POSITION, 
   in float3 InNormal: NORMAL, 
   in float3 InTex: TEXCOORD0, 
   in float4 InTangent: TEXCOORD2, 
   out float4 OutPos: POSITION, 
   out float3 OutTex: TEXCOORD0, 
   out float3 OutViewDir: TEXCOORD1, 
   out float3 OutSunDir: TEXCOORD2) 
{ 

// Transform the vertex from object space to clip space: 
   OutPos = mul(InPos, matWorldViewProj); 
// Pass the texture coordinate to the pixel shader: 
   OutTex = InTex;
   OutTex.z = mul(InPos,matWorld).y;
// Compute 3x3 matrix to transform from world space to tangent space: 
   matTangent[0] = mul(InTangent.xyz, matWorld); 
   matTangent[1] = mul(cross(InTangent.xyz, InNormal)*InTangent.w, matWorld); 
   matTangent[2] = mul(InNormal, matWorld); 
// Calculate the view direction vector in tangent space: 
   OutViewDir = normalize(mul(matTangent, (vecViewPos - mul(InPos,matWorld)))); 
// Calculate the light direction vector in tangent space: 
   OutSunDir = normalize(mul(matTangent, -vecSunDir)); 
} 
 
// Pixel Shader: 
float4 NormalMapPS(
   in float3 InTex: TEXCOORD0, 
   in float3 InViewDir: TEXCOORD1, 
   in float3 InSunDir: TEXCOORD2): COLOR 
{ 
	clip(InTex.z-water_height_var);
// Read the normal from the normal map and convert from [0..1] to [-1..1] range 
   float3 BumpNormal = tex2D(NormalMapSampler, InTex)*2 - 1; 
// Calculate the ambient term: 
   float4 Ambient = AmbientIntensity * vecAmbient; 
// Calculate the diffuse term: 
   float4 Diffuse = DiffuseIntensity * SunColor * saturate(dot(InSunDir, BumpNormal)); 
// Calculate the reflection vector: 
   float3 R = normalize(2 * dot(BumpNormal, InSunDir) * BumpNormal - InSunDir); 
// Calculate the specular term: 
   InViewDir = normalize(InViewDir); 
   float Specular = pow(saturate(dot(R, InViewDir)), SpecularPower) * SpecularIntensity; 
// Fetch the pixel color from the color map: 
   float4 Color = tex2D(ColorMapSampler, InTex); 
// Calculate final color: 
   return (Ambient + Diffuse + Specular) * Color; 
} 
 
// Technique: 
technique NormalMapTechnique 
{ 
   pass P0 
   { 
     VertexShader = compile vs_2_0 NormalMapVS(); 
     PixelShader  = compile ps_2_0 NormalMapPS(); 
   } 
}



EDIT:

Works! The water_heigh_var isn't making its way into the shader properly.. I just set my water plan height directly in the shader and it works laugh
Posted By: Stansmedia

Re: pp_set/add setting obscure screen size - 06/14/14 16:27

And for some reason the shadows on the model are rendering vertex style. All chunky.

edit: Scratch that. I set the default normal map material to the model and ran its event to check for none camera view and change. Instead of having a blank material and setting either above water or below water material.
Posted By: Superku

Re: pp_set/add setting obscure screen size - 06/15/14 08:34

Quote:
The water_heigh_var isn't making its way into the shader properly..

Then you've made a mistake somewhere, I use this feature all the time. Did you for example write
var water_height_var = 123;
instead of
var water_height = 123;
?
Posted By: Stansmedia

Re: pp_set/add setting obscure screen size - 06/15/14 19:42

in my script i have:
var water_height = 3;

in my fx file i have:
float water_height;

Not sure why its not working. Also not sure why the water isn't reflecting on larger planes in other maps. It's being rendered all "kaleidoscope" style.. Fix one problem and another pops up. Coding whack-a-mole.

Edit: I really should have backed up my mtlFX file lol
Posted By: Stansmedia

Re: pp_set/add setting obscure screen size - 06/15/14 20:01

Top right of the water plane seems to be normal. Theres like a split halfway through the screen with the inverted reflection it looks like. To the right, its splitting into a star shape. Blah.


EDIT:

I just took off NOCULL and it works fine now. Durp.

Posted By: Superku

Re: pp_set/add setting obscure screen size - 06/15/14 20:51

Quote:
3) Define var water_height = 123; in your script and write float water_height_var; at the beginning of your shader file.

See manual (I think "...flt" or similar) for more info.
Posted By: Stansmedia

Re: pp_set/add setting obscure screen size - 06/16/14 00:47

I don't know what the hell happened now. The mirrors gone all screwed up. The skys rendering transparent. And my esc key doesn't work anymore. This is so depressing.
Posted By: Stansmedia

Re: pp_set/add setting obscure screen size - 06/16/14 00:53

Seriously. Everythings gone to hell. It's like the engine is shorting out or something.
Posted By: Stansmedia

Re: pp_set/add setting obscure screen size - 06/16/14 21:04

Posted By: Superku

Re: pp_set/add setting obscure screen size - 06/16/14 22:17

Hm try setting FLAG1 on the water surface entity, then NOFLAG1 on the reflection view.
Somehow the reflection view looks wrong, too, like its tilt has the wrong sign.
Posted By: Stansmedia

Re: pp_set/add setting obscure screen size - 06/17/14 01:56

At certain angles viewing the water plane in the large indoor map, it branches out into like a kaleidoscope. In certain "portals" in the artifacts, I can see the proper reflection. In the other level, the camera stays close to the water surface the entire level. I decided to fly the camera around and after getting a little ways away the reflection disappears.

I set the water plane entity flag1 and noflag1 on the view mirror. No effect.
Posted By: Stansmedia

Re: pp_set/add setting obscure screen size - 06/17/14 02:23

EDIT:

OK. ok. She lives. AT THE MOMENT - GOD KNOWS ITS GOING TO EXPLODE AT ANY MOMENT. Superku, I tried the NOFLAG1 again and I realised for some stupid reason the waterplane model I was using had two sides (SHOOT ME). The only problem I'm dealing with right now is at certain heights, the mirror camera is catching the opposite side of the floor. Going to mess around with none flags on texture, figure something out.

Edit 2: Slipped the NOCULL back in and yeh. Good to go.

Here is what I have, in case anybody has been following this..

Keep in mind, it's tailored for the water plane to be at a Z of 0.

Water mirror
Code:
VIEW* view_mirror = { layer = -1; }  // render mirror view before camera view
BMAP* bmap_mirrortarget = NULL;
var mtlfx_mirrorvisible = 0;

function fx_mirror()
{
	if (bmap_mirrortarget)
	{
		ptr_remove(bmap_mirrortarget);	
		bmap_mirrortarget = NULL;
	}

	bmap_mirrortarget = bmap_createblack(256,256,888);
	my.material.skin2 = bmap_mirrortarget;
	view_mirror.bmap = bmap_mirrortarget;
	view_mirror.size_x = bmap_width(view_mirror.bmap);
	view_mirror.size_y = bmap_height(view_mirror.bmap);

	vec_set(view_mirror.pnormal_x,vector(0,0,1.0));	// reflect upwards
	set(view_mirror,NOSHADOW|NOPARTICLE|NOCULL);
	set(view_mirror,NOFLAG1);

	while (bmap_mirrortarget)
	{
		
		proc_mode = PROC_LATE;	// camera must be moved and mtlfx_mirrorvisible set before
		if (mtlfx_mirrorvisible) 
		{ 
			set(view_mirror,SHOW);
				view_mirror.genius = camera.genius;
				view_mirror.aspect = (screen_size.x/screen_size.y)*camera.aspect; // screen aspect, independent of render target
				view_mirror.arc    = camera.arc;
				view_mirror.fog_start = camera.fog_start;
				view_mirror.fog_end   = camera.fog_end;
				view_mirror.clip_far  = camera.clip_far;
				view_mirror.clip_near = camera.clip_near;
				view_mirror.x 	   = camera.x;
				view_mirror.y 	   = camera.y;
				view_mirror.z 	= -camera.z; // view_mirror.z = 2*view_mirror.portal_z-camera.z;
				view_mirror.pan    = camera.pan;
				view_mirror.tilt   = -camera.tilt;	// flip the vertical camera angle
				view_mirror.roll   = -camera.roll;	
		}
		else 
		{ 
			// switch rendering off when all mirror objects are outside the frustum
			reset(view_mirror,SHOW); 
		}
		mtlfx_mirrorvisible = 0;
		wait(1);
	}
}

BMAP* bmap_water_uv = NULL;

function mirror_init()
{
   fx_mirror();   // create a mirror view, set mirror target to mtl.skin2
	while (1)
	{
		if (!is(my,CLIPPED))
		{
			vec_for_max(view_mirror.portal_x,my);
			vec_add(view_mirror.portal_x,my.x);
			mtlfx_mirrorvisible = 1;
		}
		wait(1);
	}
}

function mirror_water_init()
{
	if (!bmap_water_uv)
	{
	   bmap_water_uv = bmap_to_uv(bmap_create("water.dds"));
   }
   mtl.skin1 = bmap_water_uv;
   mtl.flags |= TRANSLUCENT;
	mirror_init();	// activate mirror view
}

MATERIAL* mtl_mirrorWater =
{
	effect = "mirrorWater.fx";
	event = mirror_water_init;
}

action fx_mirrorWater()
{
	my.skill20 = 1;
	set(my,PASSABLE);
	set(my,FLAG1);
	my.material = mtl_mirrorWater;
   mtl_setup(80,80,80,80);//80
}



Material for objects to be reflected.
>> I couldn't get a variable to float into the shader, so I just have the clip at a Z of 0.

Code:
MATERIAL* mtl_specBumpymr22 =
{
	diffuse_red = 255;
	diffuse_blue = 255;
	diffuse_green = 255;	
	specular_blue = 255;	// bright specular component
	specular_green = 255;
	specular_red = 255;
	ambient_red = 0;
	ambient_blue = 0;
	ambient_green = 0;
	effect = "mirrorbump.fx";
	flags = PASS_SOLID;
}
 function mtl_event_render2()
{
 	if (render_view != camera)
 	{
 		mtl = mtl_specBumpymr22;
 		return(0);
 	}
 }

MATERIAL* bump_mirror =
{
	diffuse_red = 255;
	diffuse_blue = 255;
	diffuse_green = 255;	
	specular_blue = 255;	// bright specular component
	specular_green = 255;
	specular_red = 255;
	ambient_red = 0;
	ambient_blue = 0;
	ambient_green = 0;
	event = mtl_event_render2;
	flags = ENABLE_RENDER | PASS_SOLID;
	effect = "specBump.fx";
}



mirrorbump.fx
Code:
// Tweakables: 
static const float AmbientIntensity  = 1.0f; // The intensity of the ambient light. 
static const float DiffuseIntensity = 1.0f;  // The intensity of the diffuse light. 
static const float SpecularIntensity = 1.0f; // The intensity of the specular light. 
static const float SpecularPower = 8.0f;     // The specular power. Used as 'glossyness' factor. 
static const float4 SunColor = {0.0f, 0.0f, 0.0f, 0.0f}; // Color vector of the sunlight. 

float water_height;
  
// Application fed data: 
const float4x4 matWorldViewProj; // World*view*projection matrix. 
const float4x4 matWorld; // World matrix. 
const float4 vecAmbient; // Ambient color. 
const float4 vecSunDir;  // Sun light direction vector. 
const float4 vecViewPos; // View position. 
    
float3x3 matTangent; // hint for the engine to create tangents in TEXCOORD2

texture mtlSkin1; 
sampler ColorMapSampler = sampler_state  // Color map sampler. 
{ 
   Texture = <mtlSkin1>; 
   MipFilter = Linear;   // required for mipmapping
}; 
    
texture mtlSkin2;  // Normal map. 
sampler NormalMapSampler = sampler_state  // Normal map sampler. 
{ 
   Texture = <mtlSkin2>; 
   MipFilter = None;   // a normal map usually has no mipmaps
}; 

// Vertex Shader: 
void NormalMapVS( in float4 InPos: POSITION, 
   in float3 InNormal: NORMAL, 
   in float3 InTex: TEXCOORD0, 
   in float4 InTangent: TEXCOORD2, 
   out float4 OutPos: POSITION, 
   out float3 OutTex: TEXCOORD0, 
   out float3 OutViewDir: TEXCOORD1, 
   out float3 OutSunDir: TEXCOORD2) 
{ 

// Transform the vertex from object space to clip space: 
   OutPos = mul(InPos, matWorldViewProj); 
// Pass the texture coordinate to the pixel shader: 
   OutTex = InTex;
   OutTex.z = mul(InPos,matWorld).y;
// Compute 3x3 matrix to transform from world space to tangent space: 
   matTangent[0] = mul(InTangent.xyz, matWorld); 
   matTangent[1] = mul(cross(InTangent.xyz, InNormal)*InTangent.w, matWorld); 
   matTangent[2] = mul(InNormal, matWorld); 
// Calculate the view direction vector in tangent space: 
   OutViewDir = normalize(mul(matTangent, (vecViewPos - mul(InPos,matWorld)))); 
// Calculate the light direction vector in tangent space: 
   OutSunDir = normalize(mul(matTangent, -vecSunDir)); 
} 
 
// Pixel Shader: 
float4 NormalMapPS(
   in float3 InTex: TEXCOORD0, 
   in float3 InViewDir: TEXCOORD1, 
   in float3 InSunDir: TEXCOORD2): COLOR 
{ 
	clip(InTex.z);//water_height_var
// Read the normal from the normal map and convert from [0..1] to [-1..1] range 
   float3 BumpNormal = tex2D(NormalMapSampler, InTex)*2 - 1; 
// Calculate the ambient term: 
   float4 Ambient = AmbientIntensity * vecAmbient; 
// Calculate the diffuse term: 
   float4 Diffuse = DiffuseIntensity * SunColor * saturate(dot(InSunDir, BumpNormal)); 
// Calculate the reflection vector: 
   float3 R = normalize(2 * dot(BumpNormal, InSunDir) * BumpNormal - InSunDir); 
// Calculate the specular term: 
   InViewDir = normalize(InViewDir); 
   float Specular = pow(saturate(dot(R, InViewDir)), SpecularPower) * SpecularIntensity; 
// Fetch the pixel color from the color map: 
   float4 Color = tex2D(ColorMapSampler, InTex); 
// Calculate final color: 
   return (Ambient + Diffuse + Specular) * Color; 
} 
 
// Technique: 
technique NormalMapTechnique 
{ 
   pass P0 
   { 
     VertexShader = compile vs_2_0 NormalMapVS(); 
     PixelShader  = compile ps_2_0 NormalMapPS(); 
   } 
}

Posted By: Stansmedia

Re: pp_set/add setting obscure screen size - 06/17/14 04:34

Posted By: Stansmedia

Re: pp_set/add setting obscure screen size - 06/18/14 19:46

This is probably off topic but..

My screen keeps going all wonky when I switch levels with post processing effects.

Code:
function level_switch(var* number)
{
	trigger1 = 0;
	trigger2 = 0;
	trigger3 = 0;
	trigger4 = 0;
	trigger5 = 0;

	mtl_hdr.skill4 = floatv(30); //set HDR values
	mtl_hdr.skill1 = floatv(20);
	mtl_hdr.skill2 = 20;
	mtl_hdr.skill3 = floatv(20);
	
	if(number == 0)
	{
		day_level = 1;
		
		level_load("zero.wmb");
		wait(1);
		set_sky_lighting_suntomoon();
	}
	if(number == 1)
	{
		level_load("one.wmb");
		wait(1);
		set_sky_lighting_inside();

	}
	wait(3);
	camera.arc = 90;
	pp_set(camera,mtl_blur);//mtl_hdr
	pp_add(mtl_hdr); mtl_blur.skill1 = floatv(0);
}

Posted By: Stansmedia

Re: pp_set/add setting obscure screen size - 06/18/14 19:51

It's just pp_add. When ever I add another effect, the screen turns into a small box in the top left.
Posted By: Stansmedia

Re: pp_set/add setting obscure screen size - 06/18/14 20:41

I just realized the normal mapping shader used for the water plane clipping is only effected by the sun. I tried modifying the shader2.0 from the wiki but the inTex and etc are in.Tex, giving me "wrong token" errors when I try and use it the same way.
Posted By: Superku

Re: pp_set/add setting obscure screen size - 06/19/14 17:38

I'm not a normal mapping guy (thus near 0 experience) but you will need to use
float4 vecLightPos[8];
float4 vecLightColor[8];
and then iterate over the nearby lights and do all (?) light calculations in the pixel shader.

I assume the problem with pp_add and your blur effect is that the hdr effect consists of several stages varying in size, and I guess what you see is the size of the smallest "stage"/ its bmap. Sadly I don't know how to fix that because I'm not too familiar with said pre-made stuff, maybe you should post this question in Ask the Developers.
© 2024 lite-C Forums