Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (AndrewAMD, TipmyPip, OptimusPrime), 15,359 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
a little help if you can spare it... #74669
05/18/06 19:52
05/18/06 19:52
Joined: Oct 2002
Posts: 150
Prince Edward Island, Canada
Nagashi Offline OP
Member
Nagashi  Offline OP
Member

Joined: Oct 2002
Posts: 150
Prince Edward Island, Canada
Hello,
I was wondering if any one could help me out I’ve just started working with shaders and HLSL and I’ve been tiring to get this simple example working but just can’t seem to figure out what I’m missing. I have every thing set up properly to load an .fx file and apply it to a model (tested the setup with a working shader) but every time I use this shader all I get is a light blue un-textured version of my model. I know I must be missing something painfully simple but I just can’t seem to figure it out. This is the HLSL code in the .fx file I’m using.
Code:
float4x4 matWorldViewProj;

struct VS_OUTPUT
{
float4 Pos: POSITION;
float2 Txr1: TEXCOORD0;
};

VS_OUTPUT mainVS(
float4 inPos: POSITION,
float2 Txr1: TEXCOORD0
)
{
VS_OUTPUT Out;

// Output our transformed and projected vertex
// position and texture coordinate
Out.Pos = mul(inPos,matWorldViewProj);
Out.Txr1 = Txr1;

return Out;
}

texture entSkin1;

sampler Texture0 = sampler_state
{
Texture = <entSkin1>;
};

float4 mainPS(float4 inDiffuse: COLOR0, float2 inTxr1: TEXCOORD0) : COLOR0
{
// Output the color taken from our texture
return tex2D(Texture0,inTxr1);
}

//--------------------------------------------------------------//
// Technique Section for MyEffectGroup
//--------------------------------------------------------------//
technique MyEffect
{
pass Pass_0
{
VertexShader = compile vs_1_1 mainVS();
PixelShader = compile ps_1_1 mainPS();
}

}



Any help would be greatly appreciated.

Cheers

Nagashi


No rest for the wicked.
__________________________

Ironbound Studios
__________________________
Re: a little help if you can spare it... [Re: Nagashi] #74670
05/18/06 21:04
05/18/06 21:04
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
try changing this line:
float4 mainPS(float4 inDiffuse: COLOR0, float2 inTxr1: TEXCOORD0) : COLOR0

to this:
float4 mainPS(float2 inTxr1: TEXCOORD0) : COLOR


Sphere Engine--the premier A6 graphics plugin.
Re: a little help if you can spare it... [Re: Matt_Aufderheide] #74671
05/19/06 15:36
05/19/06 15:36
Joined: Oct 2002
Posts: 150
Prince Edward Island, Canada
Nagashi Offline OP
Member
Nagashi  Offline OP
Member

Joined: Oct 2002
Posts: 150
Prince Edward Island, Canada
Got it! Thanks man, it turns out it was my fog settings all this time… as soon as I disabled the fog, the shader stared to work as expected. I can’t believe I missed it before. I guess I just needed to step back from it for a day.

Cheers

Nagashi


No rest for the wicked.
__________________________

Ironbound Studios
__________________________

Moderated by  Blink, Hummel, Superku 

Gamestudio download | 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