light

have no light on my three.js scene

生来就可爱ヽ(ⅴ<●) 提交于 2020-02-24 00:39:17
问题 i have a problem. i have wrote some code on three.js, it consists of scene, 2 objects, renderer and camera. but when i added the light i didnt see the it! i tried some options..but nothing helped me my code there - http://codepen.io/usf/pen/LaDwh var light = new THREE.SpotLight(0xff0000); light.position.set( 0, 0, 50 ); var pointLight = new THREE.PointLight( 0xffffff); pointLight.position.set( 0, 0, 50 ); scene.add(light); scene.add(pointLight); //code renderer.render(scene, camera); i dont

Unity - 2D shader / lighting like Terraria or Starbound

我的梦境 提交于 2020-02-01 02:50:47
问题 I have a map with a lot of sprites. I could add a material to the sprite with diffuse shading and than add lots of lights. But that won't give me the result I want. And is performance heavy. Examples In the first image you can see that light is generated by torches. It's expanding its light at its best through 'open spaces' and it is stopped by blocks fairly quickly. Here is a great example of the top layer. We can see some kind of 2D directional light? Please note that the lighting inside

Unity - 2D shader / lighting like Terraria or Starbound

一世执手 提交于 2020-02-01 02:50:33
问题 I have a map with a lot of sprites. I could add a material to the sprite with diffuse shading and than add lots of lights. But that won't give me the result I want. And is performance heavy. Examples In the first image you can see that light is generated by torches. It's expanding its light at its best through 'open spaces' and it is stopped by blocks fairly quickly. Here is a great example of the top layer. We can see some kind of 2D directional light? Please note that the lighting inside

How does one retrieve the cameraID and use setTorchMode?

随声附和 提交于 2020-01-11 10:33:33
问题 So Android M recently came out and it now has a built in cameralight function called setTorchMode. I was curious as to how this worked as the parameters are (String cameraID, Boolean true/false). The Boolean obviously dictates whether the light is on or off, but how do you get the cameraID? I know there's a method called getCameraIDList, but that returns an array of IDs, not just one. How do you know which one in that list to use? 回答1: You should use CameraManager "getCameraIdList" function

how to find out screen status on an android device?

拥有回忆 提交于 2020-01-03 15:22:07
问题 Is there any way to find out that the android device screen is on or not without broadcast receivers? I want to make minute interval updates on device via service that is invoked by alarm manager. I also want to preserve battery life. So the update service will run if the device screen is on. i found a solution to my problem with this code: PowerManager powermanager; powermanager = (PowerManager) this.getSystemService(Context.POWER_SERVICE); if (powermanager.isScreenOn()) { ... } 回答1: You can

2D Lighting directional shadows?

白昼怎懂夜的黑 提交于 2020-01-02 09:59:47
问题 So I'm making a 2D game and want "realistic" lighting effects. I'm using the 2D lighting that comes with the LWRP Package i saw in this video: https://www.youtube.com/watch?v=nkgGyO9VG54 Now it looks like this: But i want my objects to throw directional shadows, like this: I am a beginner when it comes to shaders and stuff like that. Hope there is a not-too-complicated solution :) 来源: https://stackoverflow.com/questions/59531238/2d-lighting-directional-shadows

calculate light volume radius from intensity

江枫思渺然 提交于 2019-12-25 09:42:08
问题 i am currently having a problem with calculating the light volume radius for a deferred renderer. On low light intensities the volume size looks correct but when the light intensity (and therefore the radius) increases, the light volume seems to be more and more too small. I am calculating the light volume radius (in world space) like this: const float LIGHT_CUTOFF_DEFAULT = 50; mRadius = sqrt(color.length() * LIGHT_CUTOFF_DEFAULT); I then use this value to scale a box. In my shader i then

The light component is behind Image in Unity

∥☆過路亽.° 提交于 2019-12-24 23:15:23
问题 I have two different canvases: one for the background and one for the game scene Principal canvas: Background canvas: I'm having this problem: If I put an object in the principal canvas, everything seems to works but If I add a light component to this object, I'll not see the light (it is like the background image is ahead the light): Without the background canvas: With the background canvas: Any idea why? (The problem is not the BGcanvas, the problem is the image component of the BGcanvas,

Enable Disable save button during Validation using IDataErrorInfo

早过忘川 提交于 2019-12-21 09:17:36
问题 How to disable/enable a button while doing validation using IDataErrorInfo ? I am using MVVM using GalaSoft light Framework. In my Model class I have implemented IDataErrorInfo to display the error messages. public string this[string columnName] { get { Result = null; if (columnName == "FirstName") { if (String.IsNullOrEmpty(FirstName)) { Result = "Please enter first name"; } } else if (columnName == "LastName") { if (String.IsNullOrEmpty(LastName)) { Result = "Please enter last name"; } }