new effect.txt question

share shaders here
Post Reply
  • Author
  • Message
Offline
*sensei*
Posts: 372
Joined: 28 Jul 2013, 23:26

new effect.txt question

I guess to Boris, unless someone else knows.

So, we now have 2 textures in effect.txt, Original and one that will change with each pass. If I get this right this means that for blurring and blending techniques I first have to run an "empty" pass like:

SamplerColor2 is <texColor> SamplerColor is <texOriginal>

Code: Select all

float4 PS_ProcessOriginal(VS_OUTPUT_POST IN) : COLOR
{
	float4 color	= tex2D(SamplerColor2, IN.txcoord.xy);
	color.xyz		= saturate(color.xyz);
	color.w			= 1.0f;
	return color;
}

...other stuff

technique PostProcess
{
	pass P0
	{
		VertexShader = compile vs_3_0 VS_PostProcess();
		PixelShader  = compile ps_3_0 PS_ProcessOriginal();

		DitherEnable=FALSE;
		ZEnable=FALSE;
		CullMode=NONE;
		ALPHATESTENABLE=FALSE;
		SEPARATEALPHABLENDENABLE=FALSE;
		AlphaBlendEnable=FALSE;
		StencilEnable=FALSE;
		FogEnable=FALSE;
		SRGBWRITEENABLE=FALSE;
	}
}
Or, is texOriginal already filled?

Another question... at one point between the passes, is there a way to write again to texOriginal or is it a one time only on the first pass? Does it change anywhere between techniques, eg; I have 1 technique with 8 passes, and another with 4 passes. The first technique first pass will fill texOriginal and any of the other passes can use it to do effects against... now I have another technique with 4 passes, will the first pass of that technique change texOriginal again? (will texOriginal be the result of the first technique if I do so?)

And last question; how many techniques/passes can the file have? I believe it was 8, but can't recall clearly.

I already have the whole file working, just checking for optimizations and/or if I can expand what it does...

Offline
*sensei*
Posts: 372
Joined: 28 Jul 2013, 23:26

Re: new effect.txt question

After some testing it appears to take the result of P0 in the first technique, but wont update on the P0 of the second technique :( any chance this behavior can be changed? If that can change I can port all kind of nice bloom, contrast and sharpening techniques to a single effect file...

Unless I do something utterly wrong...

removed code, had bug, Gaussian was working only in 1 direction... I guess all effects must have their own technique. O well. In that case it doesn't matter.

Offline
User avatar
*blah-blah-blah maniac*
Posts: 17560
Joined: 27 Dec 2011, 08:53
Location: Rather not to say

Re: new effect.txt question

texOriginal is not for writing, it's unchanged for all passes.
8 passes max.
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7

Offline
*sensei*
Posts: 372
Joined: 28 Jul 2013, 23:26

Re: new effect.txt question

ok clear, so before first pass texColor and texOriginal are identical textures, and texOriginal will not change on all the passes...
Post Reply