New version 0.8.9 is out!

Why'd you need a shader for that (tree shader, ed)? GPU shaders should be a little more generic imho. Trees made such a way (two polygon cross) should just be exported from 3ds max with normals pointing up (my exporter plugin can do that). Why not just write a little tool that takes a bunch of dofs and changes the normals to point up?

Our 3D guys tried to export trees with normals pointing up, but the ASE export seemed to enforce recalculation of normals based on the smoothing groups etc, so that failed. Trees are also something that need to be looked at; they need normal maps (generated by SpeedTreeCAD?) and light-direction dependent lighting really.
 
  • iroker

From Wikipedia:
Cg or C for Graphics is a high-level shading language developed by Nvidia in close collaboration with Microsoft for programming vertex and pixel shaders. It is very similar to Microsoft's HLSL.
Cg is based on the C programming language and although they share the same syntax, some features of C were modified and new data types were added to make Cg more suitable for programming graphics processing units.
This language is only suitable for GPU programming and it does not replace a general programming language.
The Cg compiler outputs DirectX or OpenGL shader programs.
The Official Shaders-Language for OpenGL is GLSL and not Cg.
from Wikipedia:
GLSL (OpenGL Shading Language), also known as GLslang, is a high level shading language based on the C programming language. It was created by the OpenGL ARB to give developers more direct control of the graphics pipeline without having to use assembly language or hardware-specific languages. Current specification for GLSL is version 4.00.
OpenGL ARB:
The OpenGL Architecture Review Board (ARB) is an industry consortium that governed the OpenGL specification. It was formed in 1992, and defined the conformance tests, approved the OpenGL specification and advanced the standard. On July 31, 2006, it was announced that the ARB voted to transfer control of the OpenGL specification to Khronos Group.

Voting members included 3Dlabs, Apple, ATI, Dell, IBM, Intel, NVIDIA, SGI and Sun Microsystems, plus other contributing members. Microsoft was an original voting member, but left in March 2003
I am programming with OpenGL for years now and never used Cg-shaders.
GLSL is the standard programing language for OpenGL-only Applications.
Another reason is that i dont need any kind of dll's(like cg.dll etc.)
As you see the Cg-language is developed by nvidia and microsoft to unify the shader language to use with DX and OpenGL without changes.
from Orange Book:
GLSL as a standard high level shading language in OpenGL , Cg as a transitional or vendor specific high level shading language, I have no comment which one is better. However, GLSL should be a trend for the industry and acadermic in the coming years.
 
Our 3D guys tried to export trees with normals pointing up, but the ASE export seemed to enforce recalculation of normals based on the smoothing groups etc, so that failed. Trees are also something that need to be looked at; they need normal maps (generated by SpeedTreeCAD?) and light-direction dependent lighting really.

Cam and I had issues with getting normals to work without forcing them too (even with your max export tool iirc too Some1). Up-normals would be nice straight from the editor, but I'd hate to have to add another process in the loop to adjust them.

I also agree with Ruud that tree's need work. Right now my grass just never 'feels' right no matter what I do with textures/forced diffuse/ambient/emission etc... there probably needs to be some elegant solution with normal mapping that allows grass and trees to get a mix of lighting from 'both' sides as it were, but still look good at sunset/sunrise and so on...
It's own shader makes some sense I think.

That said, plenty of others don't, and some need to be improved lots too :D

Dave
 
From Wikipedia:
The Official Shaders-Language for OpenGL is GLSL and not Cg.
from Wikipedia:
OpenGL ARB:
I am programming with OpenGL for years now and never used Cg-shaders.
GLSL is the standard programing language for OpenGL-only Applications.
Another reason is that i dont need any kind of dll's(like cg.dll etc.)
As you see the Cg-language is developed by nvidia and microsoft to unify the shader language to use with DX and OpenGL without changes.
from Orange Book:

Hehe, it looks complicated.

So we should ideally be writing in GLSL?

Would that mean that ATI cards would conform to the full range of commands that ATI are currently having issues with under CG?

It sounds like ATI's have biased themselves towards using GLSL via the DX API more than Nvidia have, and so left some gaps. If we went straight to GLSL then the ATI products should be able to do the stuff they can't now?


An industry standard would be nice I suppose, I have no idea why it's not standard now but hey ho there you go. I'm unsure what Ruud knows about what the future holds wrt this, but if moving to GLSL now is relatively easy (before we all get CG stuff standardised), it might be the better solution!?
If GLSL is the OpenGL direct language that is here to stay, while CG might be a transitionary supported API by hardware makers, then it might be bad to use it?

Dave
 
Ruud, while you're somewhat active here, is instancing something we could possibly look forward to in the future?
Would make 3d trees and grass a breeze (pardon the pun) and would enable us to create richer environments with less overheads.
I'm not sure how this would work with community created content though...just a thought.
 
I'd like instancing to be properly looked at again. We kind of had it for cones, where we could just place cones that were in the Racer resource folder... if we could do that but with custom objects we define per track that would be nice.
Ie, tree.dof, then just refer to it loads of times with x/y/z offsets for positioning etc...!?

Dave
 
Hehe, it looks complicated.

So we should ideally be writing in GLSL?

At the time I switched to Cg, GLSL was still more unstable than Cg. GLSL seems the future, but as all things graphical, they change quite quickly. For v0.9 I'm sticking to Cg. Perhaps a year from now we might switch. Internally, I think Cg is converted to GLSL, then to assembly, although it might be a straighter path.
 

Latest News

How long have you been simracing

  • < 1 year

    Votes: 344 15.6%
  • < 2 years

    Votes: 232 10.5%
  • < 3 years

    Votes: 231 10.5%
  • < 4 years

    Votes: 175 8.0%
  • < 5 years

    Votes: 293 13.3%
  • < 10 years

    Votes: 256 11.6%
  • < 15 years

    Votes: 163 7.4%
  • < 20 years

    Votes: 124 5.6%
  • < 25 years

    Votes: 99 4.5%
  • Ok, I am a dinosaur

    Votes: 284 12.9%
Back
Top