Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Quad), 755 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: asm => hlsl..... projection shader [Re: Poison] #162026
10/19/07 18:27
10/19/07 18:27
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline
Serious User
Steempipe  Offline
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
I forget the different states, but look at these:

AddressU = Clamp; // don't wrap around edges
AddressV = Clamp; // don't wrap around edges


Edit: which you just did! Cool.


As for the tiling, you will have to revisit your coordinates in the lines:
tps = mul(Pos, matMtl) * 0.01f;
tps = (tps * 0.5f) + 0.5f;

I have not done anything similar in a year or so, so I am not sure what formulas you should try.


Last edited by Steempipe; 10/19/07 18:32.
Re: asm => hlsl..... projection shader [Re: Steempipe] #162027
10/19/07 18:56
10/19/07 18:56
Joined: Mar 2007
Posts: 99
Germany
zSteam Offline OP
Junior Member
zSteam  Offline OP
Junior Member

Joined: Mar 2007
Posts: 99
Germany
ok thanks .. it works....

but now my next problem:

the projected picture must be smaller in the near than in the far distance like a flashlight.
how can i solve this problem?

screenshot:


the code:
Code:
 

//--------------------------------------------------------------
// Texture Projection Shader HLSL
//
// © by zSteam
//
// date: 19.10.2007
// -------------------------------------------------------------

float4x4 matWorldViewProj;
float4x4 matMtl;

struct VS_OUTPUT
{
float4 Pos : POSITION;
float2 texCoord : TEXCOORD0;
float3 lightVec : TEXCOORD1;
};

VS_OUTPUT mainVS( float4 Pos : POSITION, float2 texCoord : TEXCOORD0 )
{
VS_OUTPUT Out = (VS_OUTPUT) 0;

Out.Pos = mul(Pos, matWorldViewProj);

float2 tps = (mul(Pos, matMtl) * 0.005f) + 0.5f; // ? und korrektur der position des projizierten bildes

Out.texCoord = tps;
Out.lightVec.xy = texCoord.xy;

return Out;
}

texture entSkin1;
texture mtlSkin1;

sampler BaseTex = sampler_state
{
Texture = <entSkin1>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
AddressU = wrap;
AddressV = wrap;
};

sampler ProjTex = sampler_state
{
Texture = <mtlSkin1>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
AddressU = clamp;
AddressV = clamp;
};

float4 mainPS(float2 texCoord : TEXCOORD0, float2 lightVec : TEXCOORD1 ) : COLOR
{
float4 base = tex2D( BaseTex, lightVec );
float4 proj = tex2D( ProjTex, texCoord ) * 4;

return (base + 0.1 * proj);
}

technique projector
{
pass p1
{
VertexShader = compile vs_1_1 mainVS();
PixelShader = compile ps_1_1 mainPS();
}
}

technique fallback { pass one { } }



Re: asm => hlsl..... projection shader [Re: zSteam] #162028
10/21/07 14:19
10/21/07 14:19
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
your projection matrix is orthographic, not perspective.

Re: asm => hlsl..... projection shader [Re: Joey] #162029
10/21/07 16:08
10/21/07 16:08
Joined: Mar 2007
Posts: 99
Germany
zSteam Offline OP
Junior Member
zSteam  Offline OP
Junior Member

Joined: Mar 2007
Posts: 99
Germany
hi

i'm a shader noob...
do you mean float4x4 matWorldViewProj;?
what must i change to improve the shader?

here is a compiled demo:
Texture Projection Shader.exe


=> www.alrik-online.de
A7 Commercial
Re: asm => hlsl..... projection shader [Re: zSteam] #162030
10/23/07 15:26
10/23/07 15:26
Joined: Jul 2007
Posts: 619
Turkey, Izmir
Emre Offline
User
Emre  Offline
User

Joined: Jul 2007
Posts: 619
Turkey, Izmir


Re: asm => hlsl..... projection shader [Re: Emre] #162031
10/23/07 15:28
10/23/07 15:28
Joined: Apr 2007
Posts: 582
Germany
Poison Offline
User
Poison  Offline
User

Joined: Apr 2007
Posts: 582
Germany
The file has no virus in it, I have checked it with my anti-virus software.
think that your software has got a failure.


Everything is possible, just Do it!
Re: asm => hlsl..... projection shader [Re: Poison] #162032
10/24/07 06:37
10/24/07 06:37
Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
Captain_Kiyaku Offline

Dichotomic
Captain_Kiyaku  Offline

Dichotomic

Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
Small Sidenote: If it's packed with Nacasi, some Virus Scanner will detect it as Trojan but it's not.


My Blog

"Tag und Nacht schrei ich mich heiser,
Wind weht alle Worte fort,
Tag und Nacht schrei ich mein Krähenwort!"

Subway To Sally - Krähenkönig
Page 2 of 2 1 2

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1