lighting

Adaptive threshold Binarization's bad effects

一个人想着一个人 提交于 2019-12-07 06:12:25
问题 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

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

你说的曾经没有我的故事 提交于 2019-12-07 05:49:37
问题 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

How do I fixate a light source in OpenGL while rotating an object?

北战南征 提交于 2019-12-07 05:35:58
问题 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 follows the teaspot). As you can see in my code, I only modify the lighting position upon initialization, so it is not subjected to glRotatef(), since its called

How to correct uneven illumination in images using MATLAB?

倾然丶 夕夏残阳落幕 提交于 2019-12-07 02:38:18
问题 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? 回答1: You have two options, depending on what features you want to detect and what you

Create Sun light source in OSG

独自空忆成欢 提交于 2019-12-06 08:29:08
问题 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

Drawing normals in LWJGL messes with lighting

青春壹個敷衍的年華 提交于 2019-12-06 07:07:18
My issue is fairly straightforward: Drawing normals in LWJGL causes the light source to only apply to the model until it is manually updated after initialization. Here's the lighting initialization: static Vector3f lightPosition = new Vector3f(-500f, -100f, 500f); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_LIGHT0); GL11.glLightModel(GL11.GL_LIGHT_MODEL_AMBIENT, asFloatBuffer(new float[]{0.05f, 0.05f, 0.05f, 1f})); GL11.glLight(GL11.GL_LIGHT0, GL11.GL_DIFFUSE, asFloatBuffer(new float[]{1.5f, 1.5f, 1.5f, 1f})); And here's my code for drawing the normals (loaded from the Standford

OpenGL lighting problem when rotating the camera

蓝咒 提交于 2019-12-06 04:31:04
问题 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

Gamma correction doesn't look properly corrected, is this linear?

 ̄綄美尐妖づ 提交于 2019-12-06 03:01:51
I want to implement gamma correction to my OpenGL lighting, but with gamma correction applied, my results do not seem linear at all. I also found OpenGL: Gamma corrected image doesn't appear linear which is very similar to my issue, but hasn't yet received an answer nor discussed actual diffuse lights. As an illustration, I have the following 4 light colors defined in linear space: glm::vec3 lightColors[] = { glm::vec3(0.25), glm::vec3(0.50), glm::vec3(0.75), glm::vec3(1.00) }; With each light source seperated and a basic linear attenuation applied to a diffuse lighting equation I get the

Normal mapping and phong shading with incorrect specular component

匆匆过客 提交于 2019-12-06 01:35:36
问题 I'm implementing normal/bump mapping in world space coordinates (I find those easier to work with) and my lighting worked fine without normal mapping, but when introducing normal mapping (and the new vectors calculated with the TBN matrix) the specular component of my lighting is off. The specular component is not between the camera and the light where it should be so something is wrong. However, looking at my code I could not find any issues. The tangent and bitangent come from the ASSIMP

Light source inside a room acting unexpectedly

浪尽此生 提交于 2019-12-06 01:08:56
问题 I've written several Android apps, but this is my first experience with 3D programming. I've created a room (4 walls, ceiling and floor) with a couple objects inside and am able to move the camera around it as if walking. I've textured all surfaces with various images and everything was working as expected. For context, the room is 14 units wide and 16 units deep (centered at origin), 3 units high (1 above origin and 2 below). There are 2 objects in the middle of the room, a cube and an