• Breaking News

    Specular Lighting seems Backwards Basically I copied some code from http://bit.ly/2LRoX1F to do specular lighting but I ran into an issue. The specular highlights are on the opposite side of the object. On top of that, not only does it seem reversed on the Z side, but on the Y side as well. If I make the incidence vector positive instead of negative though, the X side of the specular highlight is reversed on flat surfaces facing the viewer while on round 3d objects such as a person or sphere is perfectly fine. Like in this bit of code for the shader: vec3 incidenceVector = -surfaceToLight; //a unit vector vec3 reflectionVector = reflect(incidenceVector, normal); I literally tried everything such as flipping normals of the object or flipping just the x normals but it comes out wrong at certain angles. Im using the right handed system in OpenGL. Any help is appreciated. Thanks. https://ift.tt/eA8V8J

    Basically I copied some code from http://bit.ly/2LRoX1F to do specular lighting but I ran into an issue. The specular highlights are on the opposite side of the object. On top of that, not only does it seem reversed on the Z side, but on the Y side as well. If I make the incidence vector positive instead of negative though, the X side of the specular highlight is reversed on flat surfaces facing the viewer while on round 3d objects such as a person or sphere is perfectly fine. Like in this bit of code for the shader: vec3 incidenceVector = -surfaceToLight; //a unit vector vec3 reflectionVector = reflect(incidenceVector, normal); I literally tried everything such as flipping normals of the object or flipping just the x normals but it comes out wrong at certain angles. Im using the right handed system in OpenGL. Any help is appreciated. Thanks.

    from GameDev.net http://bit.ly/2WgTlqn

    ليست هناك تعليقات

    Post Top Ad

    ad728

    Post Bottom Ad

    ad728