Sign in to follow this  
yurixd

rendermonkey ati hlsl

Recommended Posts

Can someone tell me how to check if this vertex shader and pixel shader works using the rendermonkey ati ?? So .. How to create the textures I need .. (they are not image rgb, just grey level) how to five the vertex positions and coordinates... etc etc etc ! Thanks! float4x4 WorldViewProj; float2 texsize; sampler DiffuseSampler; void VS_HLL_EX1( in float4 vPos : POSITION, in float2 vTex : TEXCOORD0, in float2 vTex1 : TEXCOORD1, out float4 oPos : POSITION, out float2 oTex : TEXCOORD0 out float2 oTex1 : TEXCOORD1) { oPos = mul(vPos, WorldViewProj); oTex = vTex; oTex1 = mul(vTex1, float2x2(WorldViewProj)); //rotation oTex1+= float2 (WorldViewProj[3][0]); //adding translation values } void PS_HLL_EX1(in float2 vTex : TEXCOORD0, in float2 vTex1 : TEXCOORD1, out float4 Col, : COLOR0, out float4 weights : COLOR1, out float4 Col2 : COLOR2) { int i=0; float2 frac2; float2 floor2; float2 coord2[4]; //present coordonates float values [4]; float2 sampleOffsets[4]; //offsets for my 4 near neighborrs in 2D, 8 in 3D sampleOffsets[0].x = 0; sampleOffsets[0].y = 0; sampleOffsets[1].x = 1; sampleOffsets[1].y = 0; sampleOffsets[2].x = 0; sampleOffsets[2].y = 1; sampleOffsets[3].x = 1; sampleOffsets[3].y = 1 coord2[0] = vTex1*texsize - 0.5; frac2 = frac (coord2[0]); floor2 = floor (coord2[0]); for (i=0; i<4; i++){ coord2[i] = (floor2 + sampleOffsets [i] + 0.5)/texsize; values[i] = tex2D (DiffuseSampler, coord2[i]); //need this values (4floats) (I have made just a texture with grey levels //so...1float) } weight.x = (1-frac2.x)*(1-frac2.y); // 1 float output weight.y = frac2.x*(1-frac2.y); // 1 float output weight.z = (1-frac2.x)*frac2.y; //1float output weight.w = frac2.xfrac2.y; // 1float output Col2.xyzd = tex2D (DiffuseSampler, vTex); //1float (grey level) }

Share this post


Link to post
Share on other sites
What do you mean by "how to create the textures"? The process of implementing a render target in Rendermonkey is quite different than in your core application -- in which case it depends on what language your programming in.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this