lighting

Deferred Rendering with OpenGL, experiencing heavy pixelization near lit boundaries on surfaces

瘦欲@ 提交于 2019-12-05 21:26:25
Problem Explaination I am currently implementing point lights for a deferred renderer and am having trouble determining where a the heavy pixelization/triangulation that is only noticeable near the borders of lights is coming from. The problem appears to be caused by loss of precision somewhere, but I have been unable to track down the precise source. Normals are an obvious possibility, but I have a classmate who is using directx and is handling his normals in a similar manner with no issues. From about 2 meters away in our game's units (64 units/meter): A few centimeters away . Note that the

SceneKit: how to reproduce iOS 9 lighting color effect (one directional, one ambient) on iOS 10 without disabling PBR?

大兔子大兔子 提交于 2019-12-05 10:14:14
As this thread on the Apple forums mentions, lights on iOS 10 are now weaker and change how scenes look. The thread suggests setting SCNDisableLinearSpaceRendering to YES, but this did not work. Put another way, using SCNDisableLinearSpaceRendering will not make your scene look the same on iOS 10 as on iOS 9 -- at least not in our testing. We also tried: floorNode.geometry?.firstMaterial?.lightingModel = SCNMaterial.LightingModel.blinn Screenshots below show the difference between the same scene. Notice how the floor turns from green to yellow even though the lighting is the same. The scene

Fast 2D illumination algorithm?

筅森魡賤 提交于 2019-12-05 09:22:49
We have a rectangular area with translucent walls and a few light sources.We are considering only the top view,so it is a 2D problem. We need to find the approximate lighting (signal strength)at each point of the area. We need to make the algorithm really fast. The brute force method was just too slow for our purposes. You can assume that all walls attenuate by same amount, even constant amount of attenuation is acceptable. The area would be at most 1000x1000, and there would not be more than 100 light sources. The light sources can have a range of approx. 50-100 units (they are not infinite).

Adaptive threshold Binarization's bad effects

故事扮演 提交于 2019-12-05 08:33:53
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) (source: piccy.info ) At the left upper corner there is an original image, right upper corner - global threshold result. Bottom left - example of dividing image to some parts (but I am talking about analyzing image's pixel small surrounding, for example window of size 10X10). So you can see the result of such

How to correct uneven illumination in images using MATLAB?

巧了我就是萌 提交于 2019-12-05 06:04:54
I am performing feature detection in a video using MATLAB. The lighting condition varies in different parts of the video, leading to some parts getting ignored while transforming the RGB images to binary images. The lighting condition in a particular portion of the video also changes over the course of the video. Can you suggest best method in MATLAB to balance the lighting across the frame and the video? jilles de wit You have two options, depending on what features you want to detect and what you want to do with the video. Ignore the illumination of the images because (as you have concluded)

2D Tile Lighting

寵の児 提交于 2019-12-05 00:35:34
问题 I'm adding lighting to my XNA 2D tile based game. I found this article useful, but the way its done it does not support collision. What I'd like is a method to do the following Have always lit point Collision (If the light ray hits a block, then dim the next block by whatever amount until its dark to simulate shadows) I've been searching around for quite a while but no luck (I did find Catalin's tutorial, but it seemed a bit advanced for me, and didn't apply to tiles well due to redrawing the

Techniques to smooth face edges in OpenGL

牧云@^-^@ 提交于 2019-12-04 15:41:36
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)? If you are seeing single faces with per vertex normals you might have forgotten to enable smooth facing: glShadeModel(GL_SMOOTH); If that's not helping make sure all vertices with the same position also have the same normal. This should be done by blender automatically however. It's also

Create Sun light source in OSG

僤鯓⒐⒋嵵緔 提交于 2019-12-04 15:37:27
I need to set a point Source above my landscape in OpenSceneGraph that will act like a sun. I already know how to set up the light and it can be done in this fashion: //LIGHT CODE ------------------------ osg::ref_ptr<osg::Group> lightGroup (new osg::Group); osg::ref_ptr<osg::StateSet> lightSS (root->getOrCreateStateSet()); osg::ref_ptr<osg::LightSource> lightSource1 = new osg::LightSource; osg::ref_ptr<osg::LightSource> lightSource2 = new osg::LightSource; // create a local light. float xCenter = tree->getRoot()->getXCenter(); float yCenter = tree->getRoot()->getYCenter(); osg::Vec4f

OpenGL lighting problem when rotating the camera

萝らか妹 提交于 2019-12-04 14:21:35
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_POSITION, light_position); glColorMaterial(GL_FRONT, GL_AMBIENT); It works nicely. But when i start flying in the world, the lighting reacts to that as if the world was an object that is being rotated. So the lights changes when my camera angle changes. How do i

Rotate Normals in Shader

爷,独闯天下 提交于 2019-12-04 08:13:03
I have a scene with several models with individual positions and rotations. Given normals, the shaders apply simple bidirectional lighting to each pixel. That is my vertex shader. #version 150 in vec3 position; in vec3 normal; in vec2 texcoord; out vec3 f_normal; out vec2 f_texcoord; uniform mat4 model; uniform mat4 view; uniform mat4 proj; void main() { mat4 mvp = proj * view * model; f_normal = normal; f_texcoord = texcoord; gl_Position = mvp * vec4(position, 1.0); } And here is the fragment shader. #version 150 in vec3 f_normal; in vec2 f_texcoord; uniform sampler2D tex; vec3 sun = vec3(0.5