# Tagged Questions

A vector that is perpendicular to an object's surface.

16 views

### Slide along Surface

I'm very bad at Math and trigonometric functions (And I dunno if this questions fits here) I have a surface normal as a direction vector.I want my character slide along the surface, if the angle of ...
35 views

### Applying texture inside of an Icosphere?

I have implemented a code to generate an Icosphere procedurally in Unity 5.3.4f, which works pretty well. However, what I need to do know it tweak the code to make the sphere to receive texture only ...
42 views

### How do I make my indices anti-clockwise, so I can cull triangles in OpenGL? (immediate mode)

At the moment, I'm attempting a basic game engine in OpenGL using immediate mode. I'm trying to render a cube. Cube is a class with the vertices, normals, and indices. Here is part of the Cube class: ...
18 views

### Correcting Vectrosity wire frame line normals

Current Setup This is my current scene, you can see that as the sphere rotates it looks like at the edges(90 degrees) to our normal you see the lines fine but dead on the almost disappear. Grid ...
52 views

### Generating face normals with the geometry shader

I'm trying to visualize the face normals for a mesh, using the geometry shader to generate lines represeting the normal vectors. My intention was to draw that line from the triangles centroid, ...
27 views

### Light intensity on plain from angle

Given a vector (v) for the direction of light and a vector (n) for the normal of a plain. How can I calculate a rudimentary intensity value (i) where When (v) points at (n) directly/face on (i) = 1....
35 views

### How can I fix the face/normal direction of my 3d mesh in blender/UE4?

So I am playing around with UE4 to make some concept art for a game. I extracted the model I wanted to use from the game's files and imported it into blender. It's a tank with 4 parts: the hull, the ...
40 views

### Calculating vertex normals to be able to have both sharp edges and smooth gradients

I'm computing area-weighted vertex normals, but lighting looks bad on meshes containing sharp edges and corners (e.g. cubes look 'blobby' as the light leaks onto the dark sides). Is there a way of ...
29 views

### Invisible mesh. Are my normals, normal?

I'm creating this mesh during runtime in Unity3D. The mesh shape is ok, but as you can see on this screenshot, the mesh is not correctly rendered: it's only rendered when the camera is looking back ...
74 views

### C++ Modern OpenGL - Calculate Vertex Normals

I'm learning modern OpenGL and i just got started so go easy on me :). Right now im trying to understand normals but im having some difficulties. On my program i have this class which i use to draw ...
49 views

### What are projection independent ways of determining whether a normal is facing the viewer?

A position v and normal n are given in world coordinates. Also there is a view matrix V for world-eye coordinate transition and a projection matrix P for eye-ndc transition. I would like to determine, ...
70 views

### Unity 5.3.1: Black spots on terrain after applying normal map

When applying a normal to a terrain texture and elevate the area, I see blackness on the side the light is shining. Any idea what is going on here? Here you can see what i mean (added cube to show ...
51 views

### Wrong Normal When Models is Close to Each Other

I have a problem regarding my Normal FrameBuffer that creates gaps between models. The image below contains 10x2x10 block (Minecraft style) and one character. The image is outputed through: ...
134 views

### SSAO issue - surfaces darken based on camera angle

I have a strange issue in my engine where my SSAO effect will extremely darken or lighten based on my camera angle: In that example, I'm just outputting the ssao texture to the screen. The texture ...
60 views

### Normal matrix space has to be eye space?

I'm doing lighting in world space (not in eye space), so I set the normal matrix as follows: modelProgram->setUniform( "NormalMatrix", inverse(transpose(mat3(modelMatrix))) ); Now I noticed that ...
57 views

### Effect of vertex winding on normals and shading

I have implemented a Phong and Gourand shader for a triangle mesh that is being imported from an STL file. It appears to be working fairly allright but some triangles seem to be what I can only ...
357 views

### Calculated normals for mesh not working

I am trying to implement a 3D mesh viewer with C++ and OpenGL ES 2. I am currently struggling with the calculation of the normals for the vertices, or at least I think that is where the problem lies......
240 views

### How can I make a trail renderer flat with the normal of the nearest face?

I'm making a basic skid system for a car model using a trail renderer. I have everything setup and working properly except that the trail renderer always faces the camera. I want the trails to be ...
70 views

### World Space Normals Are Black

My world space normals appear fine for most of a mesh. However, some of the normals are black. I was wondering if anyone had any ideas why this is. This happens for any mesh, not just this sphere. ...
316 views

### Removing seams between procedurally-generated spherical terrain tiles

I'm working on procedural planet generation project in Unity. To create a sphere, I use the following technique: Create six planes arranged as faces of a cube Normalize all vertices' positions to ...
33 views

### Weird warping with per-vertex normals

I've had this little problem for a while now, where for some reason my calculations for per-vertex normals results in a weird distortion or warping, skewing my lighting, shading, and reflection passes....
34 views

### Unity flipped everything in level

So, I have this problem, where my level shows backfaces instead of normal facing polygons. Even the terrain have the normals flipped and the axes manipulator and object manipulator are black. It use ...
65 views

### Make a plane to display material from both sides

I know there is a setting in Cry Engine, which allows you to be able to read materials of the plane from both sides, so I am wondering if there is such a setting in Unity5. Thanks in advance
30 views

### How to calculate per vertex normals? (OpenGL) [duplicate]

I am really confused and quite much thinking about how to do that? Cross product and then, normalizing is not working for me. Or perhaps, I take them all wrong. Well, please explain me that while ...
91 views

### Malformed/Pixelated Vertex Normals

I am trying to generate vertex normals for a given triangles/vertices list with the following code: **BASE METHOD:** private void CalculateNormals() { for (Int32 i = 0; i < m_Meshes.Count; ++...
63 views

### Computing Normals for a displaced material

Disclosure: cross-posted on Unreal Answers, thought was sufficiently general for GameDev.SE I am currently rendering a displacement texture and, separately, a normal texture for my ocean. Is there a ...
591 views

### Marching Cubes Vertex Normals

I understand how to generate geometry using marching cubes at an isosurface, but I haven't been able to find a clear explanation on how to calculate the vertex normals for a mesh produced using ...
425 views

### Confused About My Code Suggesting The Normal Matrix Is Equivalent To The ModelView Matrix

I'm learning environment mapping in OpenGL by following this page. In his vertex shader, the author calculates the vertex normal in eye space with the following code: nEye = vec3(viewMatrix * ...
244 views

### Rotate a plane defined by its normal and its distance

First apologies for the amount of pictures, it's a bit hard trying to explain my problem without pictures. Hope I've provided all the relevant code. If you feel you want to know about how I am doing ...
555 views

### What is the cause of this lighting artifact on my dynamic terrain mesh?

I am generating my own terrain mesh in Unity, using pseudo-random noise to determine the height. I construct the mesh using quads, each quad is composed of two triangles. All seems to be going well, ...
7k 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) ...
57 views

### MD5Mesh Calculate Vertex Normals

I am writing an MD5 3D model loader to display animated models. The vertices and texcoords load in correctly, but the lighting is supposed to be smooth. I calculate per-vertex normals by looping ...
261 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 ...
198 views

### What is wrong with my normals?

I am trying to build a cube as a composition of many quads, with each quad being composed of two triangles. All the triangles have the same size. I am dong this (instead of drawing a single cube with ...
103 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 ...
384 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 ...
314 views

### How many normals are needed to have a smooth surface?

I'm trying to draw a smooth cloth surface and I have a per-pixel shader. I expect to have a smooth surface but it's not the case. I think the problem comes from my normals. The image show the surface ...
225 views

### Blender exported model has reduced quality in Unity when normals applied

I know this topic comes up a lot in forums, however I have spent the last 2 hours googling it and can not find a solution for my specific problem... I have exported this model from Blender, but when ...
312 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 HDR/...
514 views

### Normals in my skinned model are not animated

I have a blender skinned mode with animation. Normals look like they are messed up. This is how it looks in Unity3D before and after animation. As you can see, my model should be lit up just like ...
312 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 ...
95 views

### GLSL Normals not transforming propertly

I've been stuck on this problem for two days. I've read many articles about transforming normals, but I'm just totaly stuck. I understand choping off W component for "turning off" translation, and ...
231 views

### What is wrong with my specular phong shading

I'm sorry if this should be placed on stackoverflow instead however seeing as this is graphics related I was hoping you guys could help me: I'm attempting to write a phong shader and currently working ...
304 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 ...
1k views

### Transforming normal vector in GLSL

I'm looking at a basic diffuse light shader here http://en.wikibooks.org/wiki/GLSL_Programming/Unity/Diffuse_Reflection. Diffuse light needs the normal vector in eye-space, so that it can dot it with ...
42 views

### How to fix surface normal for mesh

I am developing an application that has to take STL files from users. However, some modeling programs seem to invert some of the surface normals. Basically some surface normals will be facing inward ...
153 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 idea ...
123 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 ...