Results 1 to 2 of 2

Thread: convert cg 1.2.1 to 1.4 compiler

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2004
    Posts
    10

    convert cg 1.2.1 to 1.4 compiler

    Hi! I am facing a difficulty.
    I removed the cg 1.2.1 compiler and installed the cg 1.4 compiler. Is there any changes in cg 1.4 compared with cg 1.2.1? I think that I should change the grammar or some other syntax in cg code.

    The code in the cg 1.2.1, as follows.

    //**********************************************
    // Input variables

    struct appdata {
    float4 position : POSITION;
    float4 color : COLOR0;
    float4 texcoord : TEXCOORD0;
    };

    // Output variables

    struct v2f {
    float4 position : POSITION;
    float4 color0 : COLOR0;
    float pointsize : PSIZE;
    };

    //################################################## ######################
    // scrPar encodes UNIFORM 4 parameters used to calculate the screen size
    // of a splat: { nearplane, height/height of nearplane, (f+n)/(f-n), -2fn/(f-n)}
    //

    v2f main(appdata I, uniform float4 scrPar)
    {
    v2f O;

    float4 P = mul(glstate.matrix.modelview[0], I.position);

    O.position = mul(glstate.matrix.mvp, I.position);
    O.color0 = I.color;
    O.pointsize = max(1.0, I.texcoord.x*scrPar.y/abs(P.z));

    return O;
    } // main

    //**************************************

    If using the cg 1.4 compiler, there is no compiling error or linking error. However, I can not get anticipated results.
    In the rendering stage, I want to see the resizeable point. but i just could see glPoint.

    But using the cg 1.2.1 compiler, there is no problem.

    Many thanks in advance.

    Best Regards,
    DB

  2. #2

    Re: convert cg 1.2.1 to 1.4 compiler

    Are you using the same profile in both cases? Could you submit the resulting code after compilation with both Cg 1.2 and Cg 1.4? It might also be a good idea to try the Cg 1.5 beta:

    http://developer.nvidia.com/object/c...it-15beta.html
    Ignacio Castaņo

Similar Threads

  1. How can i convert gl_Position?
    By Worker in forum OpenGL: Basic Coding
    Replies: 21
    Last Post: 04-05-2013, 02:36 AM
  2. Convert Vector to....
    By in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 11-08-2005, 11:39 PM
  3. how to convert 3d to 2d
    By mithun_daa in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 11-04-2003, 01:43 PM
  4. how to convert into jpg?
    By raghu in forum OpenGL: Linux
    Replies: 3
    Last Post: 02-13-2003, 03:41 PM
  5. convert
    By imported_lion in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 04-05-2000, 10:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean