Tag Info

Hot answers tagged

3

You don't need to perform backface culling manually in the geometry shader. (It's possible it could be an optimization to do so, if culling allows you to skip some expensive work in the rest of the geometry shader. But that seems unlikely to be the case.) Triangles can't have incomplete adjacency information. The vertex buffer for GL_TRIANGLE_ADJACENCY ...


2

Texture Coordinates are usually expressed in the range between [0,1]. Each (textured) vertex will have these coordinates. These coordinates are mapped to texels in the actual texture. [0,0] is the top left corner, [1,1] the bottom-right corner. When the coordinates are in a range that is multiple of 1, the texture will repeat itself. For example, for a ...


2

They are not equivalent. In the GLSL shader you use the same texture coordinate for your diffuse and normal map (gl_TexCoord[0]). In the CG shader you use separate ones (TEXCOORD0 and TEXCOORD1, which is presumably not set).


1

I'm not exactly sure what you want to hear, but I think deferred lighting is still the best for many light sources. The way you do that is that first you gather all the geometry properties by rendering the scene without any lighting at all. You basically render the scene in 4 versions into a buffer called G-Buffer: color, normal, depth, position. You may ...


1

I tried compiling it from the command-line as follows: cgc -profile glslf -entry FS_Main test.cg This gave the following error output: test.cg test.cg(18) : error C1066: invalid type in type constructor test.cg(18) : error C1010: expression left of ."rgb" is not a struct This immediately highlights the fact that you used texture2D on line 18 instead of ...


1

the limitation you're finding is somewhat related to the history of OpenGL. Prior to OpenGL 3, a fixed-function pipeline was employed. This roughly means than OpenGL would execute the exact same processing on all vertices. The only way you could modify the output was by changing the input arguments of the pipeline (vertex positions, colors, light properties, ...



Only top voted, non community-wiki answers of a minimum length are eligible