rendermonkey ati hlsl

Started by
0 comments, last by rjackets 18 years, 7 months ago
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 = (floor2 + sampleOffsets + 0.5)/texsize; values = tex2D (DiffuseSampler, coord2); //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) }
Advertisement
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.

This topic is closed to new replies.

Advertisement