ati truform a request

Davros

Legend
heres a quote i read
" On the programing side, applying TRUFORM technology to a new or existing game actually only requires one line of code:"

does anyone know what this 1 line of code is ?

tnx in advance...
 
Well, four lines, with OpenGL. It has to be enabled, the tesselation mode has to be selected, the normal vector interpolation mode must be selected, and the tesselation level must be set. Here's a segment of code from ATI's PNTriangles demo:

Code:
   if (gbPNTriangles)
   {
      glEnable(GL_PN_TRIANGLES_ATI);
   }

   if (gbPosCubic)
   {
      glPNTrianglesiATI( GL_PN_TRIANGLES_POINT_MODE_ATI, GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI);
   }
   else
   {
      glPNTrianglesiATI( GL_PN_TRIANGLES_POINT_MODE_ATI, GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI);
   }

   if (gbNormQuadratic)
   {
      glPNTrianglesiATI( GL_PN_TRIANGLES_NORMAL_MODE_ATI, GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI);
   }
   else
   {
      glPNTrianglesiATI( GL_PN_TRIANGLES_NORMAL_MODE_ATI, GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI);
   }
   glPNTrianglesiATI( GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI, gPNTrianglesLevel);

The models are where the real problem lies. Normal vectors must be correctly set -- and even then there might still be many problems. Basically, TruForm works best when the model is -meant- to be bulbous in the first place. If it is meant to have some hard edges adjacent to a smooth surface, such as with a cylinder, the result will not be entirely correct no matter what one does.
 
but the results can be amazing when it is working.

Morrowind comes to mind, for helmets etc.

I recall some great screenshots showing the diffrence it made in morrowind, but can't find em, any one else want to try?


On that note I really wish developers would use truform and put that extra bit of work into the models/env so they could benifit from it.

But ATI doesn't push things as hard as Nvidia. Im sure if truform had of been their baby back in the geforce 3 era that quite a large number of games would be using it.
 
NVidia supported RT patches (though I can't recall whether it was the Geforce 3 or 4 that introduced it), which developers seem to have ignored entirely.
 
Ostsol said:
NVidia supported RT patches (though I can't recall whether it was the Geforce 3 or 4 that introduced it), which developers seem to have ignored entirely.
Nvidia didn't push it, it wasen't one of their "big" things for the card.
 
Shapeshifter said:
On that note I really wish developers would use truform and put that extra bit of work into the models/env so they could benifit from it.
Impossible, ATI TrueForm is not fully HW accelerated on newer ATI cards, you must use Vertex Shader (which is everywhere today :)). More info in this thread.
 
The vertex shader is incapable of generating vertices. Emulation is performed entirely on the CPU.
 
Ostsol said:
The vertex shader is incapable of generating vertices. Emulation is performed entirely on the CPU.
The tesselation is fixed, so has very low CPU cost (i.e. zero just extra things to submit). The actual deformation is then done on the vertex shader via barycentric coords.

I published the code in ShaderX2 (I think it was 2 anyway).
 
DeanoC said:
Ostsol said:
The vertex shader is incapable of generating vertices. Emulation is performed entirely on the CPU.
The tesselation is fixed, so has very low CPU cost (i.e. zero just extra things to submit). The actual deformation is then done on the vertex shader via barycentric coords.

I published the code in ShaderX2 (I think it was 2 anyway).
Do you mean that predefined patches are used (and then deformed)?
 
Ostsol said:
Do you mean that predefined patches are used (and then deformed)?

Yep essentially you can upload the base mesh (the original low res model) into constant RAM and then use the vertex stream to stream in barycentric coords and triangle indices of the fixed tesselated mesh. Then the vertex shader interpolates the constant RAM vertices for the deformation from the original mesh data.

Its costs alot in the vertex shader and increases batch sizes alot (using constant RAM for vertices) but it is possible. Its alot better if you have SM3.0 hardware as you can use vertex texturing to access the original vertex data.

Not saying thats what they actually do, but its not out of the question.
 
Back
Top