Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  Using CG  (Read 1271 times)
0 Members and 1 Guest are viewing this topic.
Offline DavidYazel

Sr. Member
**

Posts: 265


Java games rock!


« on: 2003-07-15 17:51:32 »

I am interested in CG, in particular vertex programs.  for example:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
struct appin
{
    float3 position  : POSITION;
    float3 normal    : NORMAL;
    float2 texcoord0 : TEXCOORD0;
};

struct vertout
{
      float4 position  : POSITION;
      float4 color0    : COLOR0;
    float2 texcoord0 : TEXCOORD0;
};

//-----------------------------------------------------------------------------
// IN                  = Incoming per-vertex data to be processed
// modelViewProjection = Combined model-view-projection matrix
// currentAngle        = A value that goes from 0 to 360 and repeats
//-----------------------------------------------------------------------------
vertout main( appin IN,
              uniform float4x4 modelViewProjection,
              uniform float4 currentAngle )
{
      vertout OUT;

      float4 v = float4( IN.position.x, IN.position.y, IN.position.z, 1.0f );
   
   
    v.y  = sin( IN.position.x + currentAngle.x );
    v.y += sin( IN.position.z + currentAngle.x );
    v.y *= IN.position.x * 0.08f;

      OUT.position = mul( modelViewProjection, v );

    OUT.color0    = float4( 1.0f, 1.0f, 1.0f, 1.0f );
      OUT.texcoord0 = IN.texcoord0;

      return OUT;
}


So question.. what platforms are CG supported?  What versions of opengl is it supported?

Is this something I can hope to use on win, linux and max across a variety of cards which are Geforce II and equivelent ATI?

Anyone have any experience using CG?

David Yazel
Xith3D Project Founder
http://xith3d.dev.java.net

It may look complicated, but in the end it is just a bunch of triangles
Offline gregorypierce

JGO Strike Force
***

Posts: 905


I come upon thee like the blue screen of death....


« Reply #1 on: 2003-07-15 19:04:15 »

With certainty I can say that the Mac platform currently has no Cg runtime and nVidia has been dragging their feet about it. Last I checked, there was fairly strong support for Cg under Linux.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline aNt

JGO Ninja
***

Posts: 625


AFK


« Reply #2 on: 2003-07-16 04:19:01 »

well i been messing with the Cg. all abit mad if u ask me. i wouldnt make anything at this time - unless its just messing around.

Cg on my PC laptop GF2Go 460 has only a handful of Cg power. My DeskTop PC has a stack load but not all of um and thats a GFTi48000 so i guess thats abit poor. i havnt got a GFFX coss it sucks. but i bet it can do the Cg action to the max. ATI is not in the Cg as far as i can tell. When it comes to Apple Mac - i thought all u needed was a GF Card?

so all in a Cg rocks - but noone has the the cool effects u would want on there cards cap yet. worth a look mind. if u want to play with um- get the CgSDK it has a cool Browser where u can check out what your card can do. and see the Cg code that did there effects.
Games published by our own members! Go get 'em!
Offline elias

JGO Ninja
***

Posts: 638



« Reply #3 on: 2003-07-16 11:01:03 »

To avoid relying on Cg you could just offline compile your programs and use ARB_vertex_program, available in newer drivers. It's only hardware supported from gf3 and up, not sure about ati.

- elias

Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.144 seconds with 21 queries.