I've been using OpenGL for years, but after trying to use D3D for the first time, I wasted a significant amount of time trying figure out how to make my scene lights stay fixed in the world rather than fixed on my objects.
In OpenGL light positions get transformed just like everything else with the MODELVIEW matrix, so to get lights fix...
What type of light do you prefer to be working in? How do you have your light source(s) situated? Wattage? Any particular lamp recommendations?
Is there any sort of lighting environment that you hate?
...
I'm writing a little tile-based game, for which I'd like to support light sources. But my algorithm-fu is too weak, hence I come to you for help.
The situation is like this: There is a tile-based map (held as a 2D array), containing a single light source and several items standing around. I want to calculate which tiles are lit up by th...
When I light my human model in OpenGL using face normals it is very apparent where each face is on the model. The lighting becomes considerably smoother using vertex normals but still noticeable. Is there any technique available to smooth organic models without adding additional vertices (ex. subdivisions)?
...
Hello, I have trouble developing an OpenGL application.
The weird thing is that me and a friend of mine are developing a 3d scene with OpenGL under Linux, and there is some code on the repository, but if we both checkout the same latest version, that means, the SAME code this happens: On his computer after he compiles he can see the ful...
Hi
I try to implement point lights in OpenGL with GLSL. I send all the required data to the shaders. For simplicity I only use the diffuse light here.
My example shows a huge triangle which I want to illuminate with a single light source. The light source is shown as a small blue triangle.
For diffuse light I need to know the angle be...
Hey guys, I would like to develop a light/laser show editor and simulator, and for this of course I am going to learn some graphics programming. I am thinking about using C# and XNA.
I was just wondering what aspects of graphics programming I should research or focus on given the project I am working on. I am new to graphics programming...
I have a glutSolidTeapot (which has its surface normals generated automatically according to opengl.org) and a light source which is emitting diffuse light. The problem comes when I try to rotate the teapot: it seems like the light source is doing the rotation as well, not remaining in the same position I defined it (it essentially follo...
I have the following GLSL code for lighting:
uniform vec3 lightDir; // Parallel light
uniform float ambient;
uniform vec3 lightColour;
void main()
{
gl_Position = ftransform();
vec3 eyeNormal = normalize(gl_NormalMatrix * gl_Normal);
float intensity = max(ambient, dot(eyeNormal, normalize(-lightDir));
gl_FrontColo...
I have loaded an object, and when I draw the object, I set the color to green..
After drawing the object, I draw lines in red.
It all worked out fine. The problem arise when I input lighting properties.
When I create a light source, everything where the light projects becomes white.
Why does the lighting over writes my color? And how d...
I draw buildings in my game world, i shade them with the following code:
GLfloat light_ambient[] = {0.0f, 0.0f, 0.0f, 1.0f};
GLfloat light_position[] = {135.66f, 129.83f, 4.7f, 1.0f};
glShadeModel(GL_SMOOTH);
glEnable(GL_LIGHT0);
glEnable(GL_COLOR_MATERIAL);
glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);
glLightfv(GL_LIGHT0, GL_POS...
I'm trying to make a orb of light (Like a sun) but I can't seem to make it visible at all. I'll give you some snipets of code I have. It's in Java LWJGL, so it might look a little different.
private float lightAmbient[] = { 0.0f, 1.0f, 1.0f, 1.0f }; // Ambient Light Values ( NEW )
private float lightDiffuse[] = { 1.0f, 1.0f, 1.0f, ...
Trying to get a grasp on lights and working through the OpenGL Superbible book.
Below is what I am currently using for my lighting. It's placed in the SetupRC function.
The lighting is mostly working as I expected as per position etc but I am confused on why when I turn the camera, it gets brighter on places where it was previously dark...
Are there any algorithms for removing lighting from video? I have a video in which some objects are too strongly lit. How might I remove lighting from that objects without corrupting the entire video?
...
I am attempting to get a custom Shape3D to be affected by a DirectedLight in java 3D, but nothing I do seems to work.
The Shape has a geometry that is an IndexedQuadArray, with the NORMAL flag set and applied, ensuring the normal vectors are applied to the correct vertices - using indexed vectors
I have given the Appearance a Material ...
I implemented some adaptive binarization methods, they use a small window and at each pixel the threshold value is calculated. There are problems with these methods:
If we select the window size too small we will get this effect (I think the reason is because of window size is small)
At the left upper corner there is an original image,...
Hi all,
I'm working on getting a simple lighting right on my OpenGL ES iPhone scene. I'm displaying a simple object centered on the origin, and using an arcball to rotate it by touching the screen. All this works nicely, except I try to add one fixed light (fixed w.r.t. eye position) and it is badly screwed: the whole object (an icosahe...
I'd like to send my view vector to an ID3D10Effect variable in order to calculate specular lighting. How do I send a vector or even just scalar values to the HLSL from the running DirectX program? I want to do something like
render() {
//do transformations
D3DXMatrix view = camera->getViewMatrix();
basicEffect.setVariable(viewV...
I want to draw car in my world.
but i have problem with lighting when my car rotate ,it seems light position change when car is rotating;
but when i draw simple cube with glut function it work correctly.
void mydisplay(){
glLoadIdentity()
glDisable(GL_LIGHT0);
glColorMaterial ( GL_FRONT_AND_BACK, GL_DIFFUSE) ;
glColor3f(1.0,1.0,1.0);
g...
Is it possible to enable per-pixel lighting (so that I can have nice specular highlights on low tessellated surfaces) in the OpenGL fixed function pipeline?
...