The tag has no wiki summary.

learn more… | top users | synonyms

33
votes
2answers
6k views

Why are normal maps predominantly blue?

Why normal maps are predominantly blue instead of a random color? I guess normal vectors of a 3D object can point in every direction, like: (1.0, 0.1, 0.5), (0.1, -0.5, 0.3), (-0.51, 0.46, -1.0) ... ...
13
votes
1answer
1k views

Normals vs Normal maps

I am using Assimp asset importer (http://assimp.sourceforge.net/lib_html/index.html) to parse 3d models. So far, I've simply pulled out the normal vectors which are defined for each vertex in my ...
11
votes
4answers
7k views

OpenGL: why do I have to set a normal with glNormal?

I'm learning some basics of OpenGL but I'm wondering why there is a call glNormal to set the normal of vertices. If I create a simple triangle like this: glBegin(GL_TRIANGLES); ...
8
votes
1answer
274 views

Specular banding with high specular power

We're having some issues with our ray tracing in DirectX, especially with some serious banding issues with specular. With high specular power (above 8) banding starts. I'm wondering if this is an ...
7
votes
6answers
891 views

Does one need normals for a strictly 2d Game?

I'm starting to learn OpenGL by creating a pure 2D game. I have to decide on the format of the Vertices. Do I need a normal component? Or is this for a 2d component not needed? My gut feeling says I ...
7
votes
2answers
772 views

How do I generate surface normals?

I have quite a few debug drawing methods in my engine that can generate geometry useful for debugging, like spheres and cubes. At the moment I do not generate any normals for these shapes. Is there ...
7
votes
1answer
3k views

Given a plane and a point, how can I determine which side of the plane the point is on?

Given the point Vector pos = new Vector(0.0, 0.20156815648078918, -78.30000305175781, 1.0); and the plane (triangle) Vector a = new Vector(-6.599999904632568, 0.0, -78.5, 1.0); Vector b = new ...
6
votes
1answer
265 views

Unity: Why do my normals flip during an animation?

This problem boggles my mind. I have an animation running on a face object (imported from Blender). At a few points in the animation, the normals switch direction! It causes the mesh to blink. Of ...
6
votes
1answer
258 views

Transforming Normals in Bump Maps

Question I have a noise texture (perlin noise, to be precise) with its value in the alpha channel and the normal components in rgb. I now wish to, on the fly, apply some function to the alpha part ...
5
votes
5answers
7k views

Any reliable polygon normal calculation code?

Do you have any reliable 3d polygonal face normal calculation code? Any language will do, I'll port it to make it work. Even if you find some code in a 3d game engine and post it here I'll be more ...
5
votes
1answer
496 views

How can I calculate a vertex normal for a hard edge?

Here is a picture of a lovely polygon: Circled is a vertex, and numbered are its adjacent faces. I have calculated the normals of those faces as such (not yet normalized, 0-indexed): Vertex 1 ...
5
votes
1answer
2k views

Normal transformation and homogeneous coordinates

I'm very confused about the math behind the model/affine transformation expressed in homogeneous coordinates. Reading this article, I understood that a generic vector is transformed by multiplying it ...
5
votes
3answers
2k views

2D AABB vs AABB Sweep : How to calculate hit normal?

I've implemented a 2D AABBvsAABB sweep cast into my game, however, I'm having difficulty calculating the hit normal of the sweep cast. I have the sweep direction, both a and b AABB positions and xy ...
5
votes
1answer
2k views

How do I calculate the normal of a plane defined using homogeneous coordinates?

I can define a plane in 3D space using three 3D points (p0, p1, p2) that all lie in the plane and that form a non-degenerate triangle. Calculating the normal of the plane is as simple as calculating ...
5
votes
1answer
215 views

Coloring Terrain By Steepness Issue

Also I am attempting to implement some simple coloring by "slope" onto my planet and to do this I take the normal mapped normal "y" component and subtract it from one. Yet I am getting some strange ...
5
votes
1answer
2k views

How to do simple bump mapping

I'm trying to do bump mapping, and I'm getting fairly close at achieving my goal. I miss one crucial piece of my puzzle to have bump mapped effect in my scene; I need to transform the normals from my ...
4
votes
4answers
1k views

How to find two perpendicular lines given a single plane

Hey guys, i was wondering how i would go about finding the perpendicular lines relative to a surface normal. For instance say i have (0,0,1) the expected output would be (1,0,0) and (0,1,0). What ...
3
votes
5answers
2k views

Normalization of Vectors: Return a copy of the result or alter the object itself?

When calculating the normal of a vector, which is considered canon: Returning a copy: Vector2D Vector2D::Normalize() const { double a1 = GetX(); double a2 = GetY(); double a3 = GetZ(); ...
3
votes
1answer
900 views

Triangle Strips and Tangent Space Normal Mapping

Short: Do triangle strips and Tangent Space Normal mapping go together? According to quite a lot of tutorials on bump mapping, it seems common practice to derive tangent space matrices in a vertex ...
3
votes
2answers
1k views

How to create per-vertex normals when reusing vertex data?

I am displaying a cube using a vertex buffer object (gl.ELEMENT_ARRAY_BUFFER). This allows me to specify vertex indicies, rather than having duplicate vertexes. In the case of displaying a simple ...
3
votes
3answers
891 views

3Ds Max is exporting model with more normals than vertices

I made a simple teapot with the "Create Standard Primitives" option and exported it as a collada file, ended up with this: < float_array id="Teapot001-POSITION-array" count="1590"> < ...
3
votes
1answer
233 views

Can't get normals to work correctly with lighting in OpenGL [closed]

I'm trying to light up a simple 2d triangle with my cursor as a diffuse light source but can't seem to set the normal correctly for the lighting to look right. The function that calculates the normal ...
3
votes
1answer
126 views

Using normals in DirectX 10

I've got a working OBJ loader that loads vertices, indices, texture coordinates, and normals. As of right now it doesn't process texture coordinates or normals but it stores them in arrays and creates ...
3
votes
1answer
118 views

Surface normal to screen angle

I've been struggling to get this working. I simply wish to take a surface normal and convert it to a screen angle. As an example, assuming we're working with the highlighted surface on the sphere ...
3
votes
1answer
86 views

When using deferred rendering technique, what space should my normals be? Why?

I'm implementing a deferred shading technique and the following question arose: When storing the normals, should I transform to view space, or may I keep them in world space? Why? Will any of the ...
3
votes
1answer
558 views

Unusual Lighting Effects - Random Polygons Coloured

I am working on creating an object loader for use with iOS, I have managed to load the vertices, normals and face data from and OBJ file, and then place this data into arrays for reconstructing the ...
2
votes
3answers
6k views

best way to compute vertex normals from a Triangle's list

hi i'm a complete newbie in computergraphics so sorry if it's a stupid answer. i'm trying to make a simple 3d engine from scratch, more for educational purpose than for real use. for now i compute ...
2
votes
2answers
234 views

A little bit confused on how to set normals in this case

I'm learning how to use VBOs and I'm following up on the tutorial at the bottom of this page. So I went ahead and created a structure Vertex to hold vertex data.(coordinates and normals). struct ...
2
votes
2answers
814 views

How to interpolate a height-map with normals

My Task I want to interpolate a heightmap by using the normal of each nearby point of the heightmap which is calculated before. When having 4 Points before i gonna have 9 points after it. ( See this ...
2
votes
2answers
795 views

C# XNA Normals Question

I have been working on some simple XNA proof of concept for a game idea I have as well as just to further my learning in XNA. However, i seem to be stuck on these dreaded normals, and using the ...
2
votes
1answer
81 views

Calculating the winding and normal when programatically adding triangles to a mesh

I'm writing a program that takes a 2D planar polygon and extrudes it to a 3D mesh with a given height. I identify triangle edges that are borders of the polygon and now I'm trying to automatically ...
2
votes
2answers
172 views

.md5mesh normals are not smooth

I'm currently working on a project that requires me to load .md5mesh format and draw it. Following this link I've managed to load the mesh into the engine successfully, but a problem arises when ...
2
votes
1answer
125 views

Pixelated Normal Generation

I am generating normals for each vertex in a standard 512*512 quad. Yet when I do using the following code: public Vector3f[] normals(Vector3f[] surface){ Vector3f[] normals = new ...
2
votes
2answers
1k views

Calculating vertex normals on the GPU

I have some height-map sampled on a regular grid stored in an array. Now, I want to use the normals on the sampled vertices for some smoothing algorithm. The way I'm currently doing it is as follows: ...
2
votes
1answer
186 views

XNA calculate normals for linesegment

I am quite new to 3D graphical programming and thus far only understand that normal somehow define the direction in which a vertex faces and therefore the direction in which light is reflected. I have ...
2
votes
1answer
1k views

How do I determine the collision normal in an axis aligned bounding box collision?

I have a 3d moving box and a stationary box. I can detect collisions ok but now I would like to slide the moving box against the stationary box as a collision response. For this I need the normal of ...
2
votes
1answer
1k views

Blender mesh mirroring screws up normals when importing in Unity

My issue is as follows: I've modeled a robot in Blender 2.6. It's a mech-like biped or if you prefer, it kindda looks like a chicken. Since it's symmetrical on the XZ plane, I've decided to mirror ...
2
votes
0answers
210 views

Vertex Normals, Loading Mesh Data

My test FBX mesh is a cube. From what I surmise, it seems that the cube is on the extreme end of this issue, but I believe that the same issue would be able to occur in any mesh: Each vertex has 3 ...
1
vote
3answers
197 views

Is it possible to gain performance by omitting vertex normals in the GPU pipe?

I am working on a rendering problem where I want to render as many raw triangles to the screen as I can with either OpenGL or DirectX with the absolute fastest performance possible. I wondered about ...
1
vote
2answers
253 views

Why are normal maps in tangent space but not in normal space?

I want to implement normal mapping in my little game engine. When getting into normal mapping, I wonder why normal maps are typically in tangent space but not in normal space? That normal maps in ...
1
vote
2answers
2k views

Calculating the 2D edge normals of a triangle

What's a reliable way to calculate a 2D normal vector for each edge of a triangle, so that each normal is pointing outwards from the triangle? To clarify, given any triangle - for each edge (e.g ...
1
vote
1answer
99 views

Given face normal and vertices of a triangle, how to find the acyclic order of vertices?

I'm in the process of constructing a custom 3D triangle mesh. I found the vertices of the triangle in the 3D space and it's face normal. How do I find the acyclic order of vertices? If I draw the ...
1
vote
1answer
494 views

How can I calculate a terrain's normals?

Im trying to implement basic lighting in Opengl 3+ (a sun) with this tutorial : http://www.mbsoftworks.sk/index.php?page=tutorials&series=1&tutorial=11 Im building a basic terrain and its ...
1
vote
1answer
154 views

How do I draw an isoline in a shader with a triangle topology?

I have some problems with my displacment. So I would like to have a simple little isoline starting in every triangles face center of the mash pointing in the direction of the corresponding faces ...
1
vote
1answer
142 views

XNA Diffuse Shader Issue. Edge lighting problem. Image Attached

As you can see in this image the diffuse shading is working correctly in some places but in other places such as the the bottom of the sphere you can see the squares/triangles of the mesh. Any ...
1
vote
1answer
66 views

Why isn't the bitangent calculated?

In teh tangent space vertex attributes why is the bitangent (aka binormal) provided as an attribute instead of calculated? If the three vectors of the tangent space must be perpendicular then the ...
1
vote
1answer
296 views

Problem calculating normals for heightmaps

So far I have been using normal avering to calculate the normals for my vertices in my heightmap, with good graphical result (see picture), however it is terribly slow. With a incresing image size the ...
1
vote
1answer
136 views

XNA Strange Lighting, Shader

Hey guys, i have strange lighting problem. I've written my own "deferred lighting" shader and this happend: Pic: Normal-Map Pic: Light-Map As long as i only use one big mesh everything seems ...
1
vote
1answer
336 views

Why isn't my lighting working properly? Are my normals messed up?

I'm relatively new to OpenGL and I am trying to draw a 3D model (loaded from a 3ds file using lib3ds) using OpenGL with lighting, but about half of it is drawn in black. I set up the light as such: ...
1
vote
1answer
146 views

The math of normal mapping without a dot product

As far as I understand the technical details about a good normal mapping they go like this: everything gravitates around the concept of vertex the artist provides an RGB image and an UV map, the UV ...