HLSL Guides?

Place to talk about all that new hardware and decaying software you have.

Moderator: General Mods

Post Reply
gllt
NO VOWELS >:[
Posts: 753
Joined: Sun Aug 31, 2008 12:59 pm
Location: ALABAMA
Contact:

HLSL Guides?

Post by gllt »

Particularly ones that can apply to mudlord's patch.
Everything I've found on the net has been of no real help to me, I've just been figuring it out on my own.

EDIT; How come..

Code: Select all

float4 Pass1( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Color = tex2D( s0, Tex.xy );
if (Color<0.2 || Color>0.9) Color = 0; else Color = 1.0;
   return Color;
} 
Doesn't work and..

Code: Select all

Color.rgb = (Color.r+Color.g+Color.b)/3.0f;
if (Color.r<0.2 || Color.r>0.9) Color.r = 0; else Color.r = 1.0f;
if (Color.g<0.2 || Color.g>0.9) Color.g = 0; else Color.g = 1.0f;
if (Color.b<0.2 || Color.b>0.9) Color.b = 0; else Color.b = 1.0f;
does?
whicker
Trooper
Posts: 479
Joined: Sat Nov 27, 2004 4:33 am

Post by whicker »

because "float 4" is a collection of 4 different variables. and your 0.2 and 0.9 are only a single dimension variable.

the second example splits it off into its component parts (.r, .g, .b). But even then the second example is still a bit fishy, but hey, it compiles, right?

that's not to say they probably have some "brightness" function that will take a color array and return a single dimension variable that can then be compared with a single constant.
gllt
NO VOWELS >:[
Posts: 753
Joined: Sun Aug 31, 2008 12:59 pm
Location: ALABAMA
Contact:

Post by gllt »

Sorry for digging a dead thread, but I thought I'd place my question here.

http://www.roborealm.com/help/Convolution.php

I get these.
I basically get Scale2x as well, what's going on.
Now how in the world's frogs do I implement convolution matrixes in HLSL :V
h4tred

Post by h4tred »

Read up here: http://www.si-gamer.net/gulikoza/
Beware, Gulikoza uses a different implementation to what is used by VG's and I's proxy DLL.

And yes, this is the same person that made the shader patcher.
Post Reply