Search Results

Search found 26712 results on 1069 pages for 'light show'.

Page 9/1069 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Nicely printing/showing a binary tree in Haskell

    - by nicole
    I have a tree data type: data Tree a b = Branch b (Tree a b) (Tree a b) | Leaf a ...and I need to make it an instance of Show, without using deriving. I have found that nicely displaying a little branch with two leaves is easy: instance (Show a, Show b) => Show (Tree a b) where show (Leaf x) = show x show (Branch val l r) = " " ++ show val ++ "\n" ++ show l ++ " " ++ show r But how can I extend a nice structure to a tree of arbitrary size? It seems like determining the spacing would require me to know just how many leaves will be at the very bottom (or maybe just how many leaves there are in total) so that I can allocate all the space I need there and just work 'up.' I would probably need to call a size function. I can see this being workable, but is that making it harder than it is?

    Read the article

  • Disable Wireless light?

    - by GuyNoir
    Is there any way (program, registry key, etc.) that I could disable the little light that turns on whenever wifi is enabled? I would still like to have wifi enabled, it's just that I want the light to be off. If it helps I have a Dell Wireless 1397 WLAN Mini-Card. Thanks.

    Read the article

  • Disable USB powered light from command line?

    - by Jeff Welling
    I have a nice little USB light which has no off switch, it is 'on' for the duration of being plugged in. My question is, is there a way of disabling the USB port so as to turn off the light while it is still plugged in? Preferably, this could be done from the command line, but if it's possible at all that would be really cool regardless. I use Mac and Linux, but am interested to learn if this is possible in any OS, or if physical hardware prevents usage like this.

    Read the article

  • Computer-controlled Lights and Music Synced into Christmas Rock Spectacular

    - by Jason Fitzpatrick
    This spectacular computer controlled and synchronized lighting display combines thousands of feet of LED lighting, multiple controllers, and a rock medley to great effect. The above display started life as the personal Christmas light display of Sioux Falls, ND resident Joe Noe. When Noe moved, he donated his display to a local mall in order to preserve the tradition of people stopping by to see it and making donations to the Make-A-Wish foundation. The local mall, Western Mall, expanded the display and added in even more LEDs and controllers. The end result is an impressive display synced to a Christmas rock medley by UK musician Richard Campbell. [via Mashable] Secure Yourself by Using Two-Step Verification on These 16 Web Services How to Fix a Stuck Pixel on an LCD Monitor How to Factory Reset Your Android Phone or Tablet When It Won’t Boot

    Read the article

  • Lighting a Voxel World Realistically

    - by sharethis
    I am new to game development and never implemented a complicated (and realistic) lighting. My game uses a 3d voxel terrain world (like Minecraft). To hold the data I use octrees. My goal is to render a more realistic world scene like in most voxel games. For that I want to use a bezier algorithm to round out the blocky world. Assume that I already have a large generated polygon of my terrain (or some of them). I heard of some techniques like volumetric light, global illumination, ... What approaches of a very realistic lighting are there for my "organic shaped" voxel game?

    Read the article

  • jquery ie6 issue swaping videos through hide/show while playing.

    - by user217181
    So my code is: Click the link show the div. I'm using the jquery flash embed object. $(document).ready( function() { $('a.overview').click( function() { $('#overview').show(); // show div.contact $('#evaulting').hide(); // hide div.contact $('#his').hide(); // hide div.contact }); }); $(document).ready( function() { $('a.evaulting').click( function() { $('#evaulting').show(); // show div.contact $('#overview').hide(); // hide div.contact $('#his').hide(); // hide div.contact }); }); <div id="overview" style="display:none"> <ul> <li rel="play-norelated.swf:680:480:true:ffffff" class="flash-replaced"> <embed width="680" height="480" type="application/x-shockwave-flash" src="play-norelated.swf" pluginspage="http://www.adobe.com/go/getflashplayer" flashvars="playVideo=ent_web_480x" bgcolor="ffffff" /> <div class="alt"><h1>To Play Iron Mountain Videos - You will need to upgrade your Flash Player</h1> <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p></div> </li> </ul> </div> <div id="evaulting" style="display:none"> <ul> <li rel="play-norelated.swf:680:480:true:ffffff" class="flash-replaced"> <embed width="680" height="480" type="application/x-shockwave-flash" src="play-norelated.swf" pluginspage="http://www.adobe.com/go/getflashplayer" flashvars="playVideo=evaulting_web_480x" bgcolor="ffffff" /> <div class="alt"><h1>To Play Iron Mountain Video's - You will need to upgrade your Flash Player</h1> <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p></div> </li> </ul> </div> When I repeat this code and get the second video to load on click. It works in all browsers. The only issue I'm running into is that in IE6 the video keeps playing and in other browsers it stops the video your watching and loads the one you clicked on. I looked into using the .remove object or the .append to a div, but I can't seem to get that to work and if it does work will it play nice with IE6. Try it out and maybe solve my issues.

    Read the article

  • Normal map applied as diffuse textures looks wrong

    - by KaiserJohaan
    Diffuse textures works fine, but I am having problem with normal maps, so I thought I'd tried to apply the normal maps as the diffuse map in my fragment shader so I could see everything is OK. I comment-out my normal map code and just set the diffuse map to the normal map and I get this: http://postimg.org/image/j9gudjl7r/ Looks like a smurf! This is the actual normal map of the main body: http://postimg.org/image/sbkyr6fg9/ Here is my fragment shader, notice I commented out normal map code so I could debug the normal map as a diffuse texture "#version 330 \n \ \n \ layout(std140) uniform; \n \ \n \ const int MAX_LIGHTS = 8; \n \ \n \ struct Light \n \ { \n \ vec4 mLightColor; \n \ vec4 mLightPosition; \n \ vec4 mLightDirection; \n \ \n \ int mLightType; \n \ float mLightIntensity; \n \ float mLightRadius; \n \ float mMaxDistance; \n \ }; \n \ \n \ uniform UnifLighting \n \ { \n \ vec4 mGamma; \n \ vec3 mViewDirection; \n \ int mNumLights; \n \ \n \ Light mLights[MAX_LIGHTS]; \n \ } Lighting; \n \ \n \ uniform UnifMaterial \n \ { \n \ vec4 mDiffuseColor; \n \ vec4 mAmbientColor; \n \ vec4 mSpecularColor; \n \ vec4 mEmissiveColor; \n \ \n \ bool mHasDiffuseTexture; \n \ bool mHasNormalTexture; \n \ bool mLightingEnabled; \n \ float mSpecularShininess; \n \ } Material; \n \ \n \ uniform sampler2D unifDiffuseTexture; \n \ uniform sampler2D unifNormalTexture; \n \ \n \ in vec3 frag_position; \n \ in vec3 frag_normal; \n \ in vec2 frag_texcoord; \n \ in vec3 frag_tangent; \n \ in vec3 frag_bitangent; \n \ \n \ out vec4 finalColor; " " \n \ \n \ void CalcGaussianSpecular(in vec3 dirToLight, in vec3 normal, out float gaussianTerm) \n \ { \n \ vec3 viewDirection = normalize(Lighting.mViewDirection); \n \ vec3 halfAngle = normalize(dirToLight + viewDirection); \n \ \n \ float angleNormalHalf = acos(dot(halfAngle, normalize(normal))); \n \ float exponent = angleNormalHalf / Material.mSpecularShininess; \n \ exponent = -(exponent * exponent); \n \ \n \ gaussianTerm = exp(exponent); \n \ } \n \ \n \ vec4 CalculateLighting(in Light light, in vec4 diffuseTexture, in vec3 normal) \n \ { \n \ if (light.mLightType == 1) // point light \n \ { \n \ vec3 positionDiff = light.mLightPosition.xyz - frag_position; \n \ float dist = max(length(positionDiff) - light.mLightRadius, 0); \n \ \n \ float attenuation = 1 / ((dist/light.mLightRadius + 1) * (dist/light.mLightRadius + 1)); \n \ attenuation = max((attenuation - light.mMaxDistance) / (1 - light.mMaxDistance), 0); \n \ \n \ vec3 dirToLight = normalize(positionDiff); \n \ float angleNormal = clamp(dot(normalize(normal), dirToLight), 0, 1); \n \ \n \ float gaussianTerm = 0.0; \n \ if (angleNormal > 0.0) \n \ CalcGaussianSpecular(dirToLight, normal, gaussianTerm); \n \ \n \ return diffuseTexture * (attenuation * angleNormal * Material.mDiffuseColor * light.mLightIntensity * light.mLightColor) + \n \ (attenuation * gaussianTerm * Material.mSpecularColor * light.mLightIntensity * light.mLightColor); \n \ } \n \ else if (light.mLightType == 2) // directional light \n \ { \n \ vec3 dirToLight = normalize(light.mLightDirection.xyz); \n \ float angleNormal = clamp(dot(normalize(normal), dirToLight), 0, 1); \n \ \n \ float gaussianTerm = 0.0; \n \ if (angleNormal > 0.0) \n \ CalcGaussianSpecular(dirToLight, normal, gaussianTerm); \n \ \n \ return diffuseTexture * (angleNormal * Material.mDiffuseColor * light.mLightIntensity * light.mLightColor) + \n \ (gaussianTerm * Material.mSpecularColor * light.mLightIntensity * light.mLightColor); \n \ } \n \ else if (light.mLightType == 4) // ambient light \n \ return diffuseTexture * Material.mAmbientColor * light.mLightIntensity * light.mLightColor; \n \ else \n \ return vec4(0.0); \n \ } \n \ \n \ void main() \n \ { \n \ vec4 diffuseTexture = vec4(1.0); \n \ if (Material.mHasDiffuseTexture) \n \ diffuseTexture = texture(unifDiffuseTexture, frag_texcoord); \n \ \n \ vec3 normal = frag_normal; \n \ if (Material.mHasNormalTexture) \n \ { \n \ diffuseTexture = vec4(normalize(texture(unifNormalTexture, frag_texcoord).xyz * 2.0 - 1.0), 1.0); \n \ // vec3 normalTangentSpace = normalize(texture(unifNormalTexture, frag_texcoord).xyz * 2.0 - 1.0); \n \ //mat3 tangentToWorldSpace = mat3(normalize(frag_tangent), normalize(frag_bitangent), normalize(frag_normal)); \n \ \n \ // normal = tangentToWorldSpace * normalTangentSpace; \n \ } \n \ \n \ if (Material.mLightingEnabled) \n \ { \n \ vec4 accumLighting = vec4(0.0); \n \ \n \ for (int lightIndex = 0; lightIndex < Lighting.mNumLights; lightIndex++) \n \ accumLighting += Material.mEmissiveColor * diffuseTexture + \n \ CalculateLighting(Lighting.mLights[lightIndex], diffuseTexture, normal); \n \ \n \ finalColor = pow(accumLighting, Lighting.mGamma); \n \ } \n \ else { \n \ finalColor = pow(diffuseTexture, Lighting.mGamma); \n \ } \n \ } \n"; Here is my wrapper around a texture OpenGLTexture::OpenGLTexture(const std::vector<uint8_t>& textureData, uint32_t textureWidth, uint32_t textureHeight, TextureFormat textureFormat, TextureType textureType, Logger& logger) : mLogger(logger), mTextureID(gNextTextureID++), mTextureType(textureType) { glGenTextures(1, &mTexture); CHECK_GL_ERROR(mLogger); glBindTexture(GL_TEXTURE_2D, mTexture); CHECK_GL_ERROR(mLogger); GLint glTextureFormat = (textureFormat == TextureFormat::TEXTURE_FORMAT_RGB ? GL_RGB : textureFormat == TextureFormat::TEXTURE_FORMAT_RGBA ? GL_RGBA : GL_RED); glTexImage2D(GL_TEXTURE_2D, 0, glTextureFormat, textureWidth, textureHeight, 0, glTextureFormat, GL_UNSIGNED_BYTE, &textureData[0]); CHECK_GL_ERROR(mLogger); glGenerateMipmap(GL_TEXTURE_2D); CHECK_GL_ERROR(mLogger); glBindTexture(GL_TEXTURE_2D, 0); CHECK_GL_ERROR(mLogger); } OpenGLTexture::~OpenGLTexture() { glDeleteBuffers(1, &mTexture); CHECK_GL_ERROR(mLogger); } And here is the sampler I create which is shared between Diffuse and normal textures // texture sampler setup glGenSamplers(1, &mTextureSampler); CHECK_GL_ERROR(mLogger); glSamplerParameteri(mTextureSampler, GL_TEXTURE_MAG_FILTER, GL_LINEAR); CHECK_GL_ERROR(mLogger); glSamplerParameteri(mTextureSampler, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); CHECK_GL_ERROR(mLogger); glSamplerParameteri(mTextureSampler, GL_TEXTURE_WRAP_S, GL_REPEAT); CHECK_GL_ERROR(mLogger); glSamplerParameteri(mTextureSampler, GL_TEXTURE_WRAP_T, GL_REPEAT); CHECK_GL_ERROR(mLogger); glSamplerParameterf(mTextureSampler, GL_TEXTURE_MAX_ANISOTROPY_EXT, mCurrentAnisotropy); CHECK_GL_ERROR(mLogger); glUniform1i(glGetUniformLocation(mDefaultProgram.GetHandle(), "unifDiffuseTexture"), OpenGLTexture::TEXTURE_UNIT_DIFFUSE); CHECK_GL_ERROR(mLogger); glUniform1i(glGetUniformLocation(mDefaultProgram.GetHandle(), "unifNormalTexture"), OpenGLTexture::TEXTURE_UNIT_NORMAL); CHECK_GL_ERROR(mLogger); glBindSampler(OpenGLTexture::TEXTURE_UNIT_DIFFUSE, mTextureSampler); CHECK_GL_ERROR(mLogger); glBindSampler(OpenGLTexture::TEXTURE_UNIT_NORMAL, mTextureSampler); CHECK_GL_ERROR(mLogger); SetAnisotropicFiltering(mCurrentAnisotropy); The diffuse textures looks like they should, but the normal looks so wierd. Why is this?

    Read the article

  • Network latency and speed of light

    - by James
    This was kinda of covered by the following Is minimum latency fixed by the speed of light? , but i would like to add the follow up a bit. The scenario is as follows; we have two opposing sites one on the West Coast of the US and one in Ireland. The customer is in central Europe, and has requested a latency test. Ireland gives responses of ~65-70ms. However the West Coast guys claim to be faster with a response of 60ms. Now a quick check says that light in fiber would take about 42ms to make the trip to the States and 8.5ms to Ireland. So obviously this is a single hop and does not include routers, switches, firewalls, protocol overhead etc. Would I be right to call BS on their figures? As a final note I tested a ping to Google IP address that was allegedly on the west coast from a site that covered a similar distance and was amazed to get a response time of 20ms. Suggesting ICMP packets that travel twice the speed of light. So A) what am I missing B) Am I right to suspect shenanigans? UPDATE: Guys thanks so far for your help and I have been reading various previous questions on this. About 5 years I had an issue where the hop from the UK to Ireland added 10ms of latency no matter what we did. In the end I moved the servers; So imagine my surprise when I have guys that claim they are 5ms faster with a transatlantic trip. So again should I call BS? Oh and assume both sites are normal mortals that don't have access to Google magical routing, warp dives or flux capacitors. :)

    Read the article

  • Why will show() only work for fields that are hidden using inline css?

    - by Chris
    I am hiding an element using inline css, like so: <span class="hidden-nojs" style="display:none">Some text</span> Next I use jQuery to show the element, like so: $(".hidden-nojs").show(); This works great. As soon as I remove the inline css and put display:none on the external css stylesheet for the hidden-nojs class, it stops working. This is what I wrote in the external stylesheet: .hidden-nojs { display: none; } I'm assuming that the external stylesheet loads after the jQuery has already run? This is somewhat annoying as I would like to hide multiple elements with css and would like to avoid using inline css. Why will show() only work for fields that are hidden using inline css? How can I fix this problem?

    Read the article

  • Why do my raytraced spheres have dark lines when lit with multiple light sources?

    - by Curyous
    I have a simple raytracer that only works back up to the first intersection. The scene looks OK with two different light sources, but when both lights are in the scene, there are dark shadows where the lit area from one ends, even if in the middle of a lit area from the other light source (particularly noticeable on the green ball). The transition from the 'area lit by both light sources' to the 'area lit by just one light source' seems to be slightly darker than the 'area lit by just one light source'. The code where I'm adding the lighting effects is: // trace lights for ( int l=0; l<primitives.count; l++) { Primitive* p = [primitives objectAtIndex:l]; if (p.light) { Sphere * lightSource = (Sphere *)p; // calculate diffuse shading Vector3 *light = [[Vector3 alloc] init]; light.x = lightSource.centre.x - intersectionPoint.x; light.y = lightSource.centre.y - intersectionPoint.y; light.z = lightSource.centre.z - intersectionPoint.z; [light normalize]; Vector3 * normal = [[primitiveThatWasHit getNormalAt:intersectionPoint] retain]; if (primitiveThatWasHit.material.diffuse > 0) { float illumination = DOT(normal, light); if (illumination > 0) { float diff = illumination * primitiveThatWasHit.material.diffuse; // add diffuse component to ray color colour.red += diff * primitiveThatWasHit.material.colour.red * lightSource.material.colour.red; colour.blue += diff * primitiveThatWasHit.material.colour.blue * lightSource.material.colour.blue; colour.green += diff * primitiveThatWasHit.material.colour.green * lightSource.material.colour.green; } } [normal release]; [light release]; } } How can I make it look right?

    Read the article

  • Acer aspire 5520 power light blinks no boot

    - by Shawn Mclean
    My laptop was working fine last night, I hibernated it and went to sleep. Got up, pressed the power button. The power light comes on for 4 seconds and the hdd light blinked a few times, then it turned off for a second then repeats the process. The only way to stop this process/power down is to remove the AC and take out the battery. It does not even reach a boot screen, nothing shows up on the screen, fan does not start. People on this forum has the same problem but they suggest to put the laptop in a oven and heat it (reflow). What could be the problem? Is there another solution other than a reflow? I dont feel like putting my motherboard in the oven.

    Read the article

  • Light following me around the room. Something is wrong with my shader!

    - by Robinson
    I'm trying to do a spot (Blinn) light, with falloff and attenuation. It seems to be working OK except I have a bit of a space problem. That is, whenever I move the camera the light moves to maintain the same relative position, rather than changing with the camera. This results in the light moving around, i.e. not always falling on the same surfaces. It's as if there's a flashlight attached to the camera. I'm transforming the lights beforehand into view space, so Light_Position and Light_Direction are already in eye space (I hope!). I made a little movie of what it looks like here: My camera rotating around a point inside a box. The light is fixed in the centre up and its "look at" point in a fixed position in front of it. As you can see, as the camera rotates around the origin (always looking at the centre), so don't think the box is rotating (!). The lighting follows it around. To start, some code. This is how I'm transforming the light into view space (it gets passed into the shader already in view space): // Compute eye-space light position. Math::Vector3d eyeSpacePosition = MyCamera->ViewMatrix() * MyLightPosition; MyShaderVariables->Set(MyLightPositionIndex, eyeSpacePosition); // Compute eye-space light direction vector. Math::Vector3d eyeSpaceDirection = Math::Unit(MyLightLookAt - MyLightPosition); MyCamera->ViewMatrixInverseTranspose().TransformNormal(eyeSpaceDirection); MyShaderVariables->Set(MyLightDirectionIndex, eyeSpaceDirection); Can anyone give me a clue as to what I'm doing wrong here? I think the light should remain looking at a fixed point on the box, regardless of the camera orientation. Here are the vertex and pixel shaders: /////////////////////////////////////////////////// // Vertex Shader /////////////////////////////////////////////////// #version 420 /////////////////////////////////////////////////// // Uniform Buffer Structures /////////////////////////////////////////////////// // Camera. layout (std140) uniform Camera { mat4 Camera_View; mat4 Camera_ViewInverseTranspose; mat4 Camera_Projection; }; // Matrices per model. layout (std140) uniform Model { mat4 Model_World; mat4 Model_WorldView; mat4 Model_WorldViewInverseTranspose; mat4 Model_WorldViewProjection; }; // Spotlight. layout (std140) uniform OmniLight { float Light_Intensity; vec3 Light_Position; vec3 Light_Direction; vec4 Light_Ambient_Colour; vec4 Light_Diffuse_Colour; vec4 Light_Specular_Colour; float Light_Attenuation_Min; float Light_Attenuation_Max; float Light_Cone_Min; float Light_Cone_Max; }; /////////////////////////////////////////////////// // Streams (per vertex) /////////////////////////////////////////////////// layout(location = 0) in vec3 attrib_Position; layout(location = 1) in vec3 attrib_Normal; layout(location = 2) in vec3 attrib_Tangent; layout(location = 3) in vec3 attrib_BiNormal; layout(location = 4) in vec2 attrib_Texture; /////////////////////////////////////////////////// // Output streams (per vertex) /////////////////////////////////////////////////// out vec3 attrib_Fragment_Normal; out vec4 attrib_Fragment_Position; out vec2 attrib_Fragment_Texture; out vec3 attrib_Fragment_Light; out vec3 attrib_Fragment_Eye; /////////////////////////////////////////////////// // Main /////////////////////////////////////////////////// void main() { // Transform normal into eye space attrib_Fragment_Normal = (Model_WorldViewInverseTranspose * vec4(attrib_Normal, 0.0)).xyz; // Transform vertex into eye space (world * view * vertex = eye) vec4 position = Model_WorldView * vec4(attrib_Position, 1.0); // Compute vector from eye space vertex to light (light is in eye space already) attrib_Fragment_Light = Light_Position - position.xyz; // Compute vector from the vertex to the eye (which is now at the origin). attrib_Fragment_Eye = -position.xyz; // Output texture coord. attrib_Fragment_Texture = attrib_Texture; // Compute vertex position by applying camera projection. gl_Position = Camera_Projection * position; } and the pixel shader: /////////////////////////////////////////////////// // Pixel Shader /////////////////////////////////////////////////// #version 420 /////////////////////////////////////////////////// // Samplers /////////////////////////////////////////////////// uniform sampler2D Map_Diffuse; /////////////////////////////////////////////////// // Global Uniforms /////////////////////////////////////////////////// // Material. layout (std140) uniform Material { vec4 Material_Ambient_Colour; vec4 Material_Diffuse_Colour; vec4 Material_Specular_Colour; vec4 Material_Emissive_Colour; float Material_Shininess; float Material_Strength; }; // Spotlight. layout (std140) uniform OmniLight { float Light_Intensity; vec3 Light_Position; vec3 Light_Direction; vec4 Light_Ambient_Colour; vec4 Light_Diffuse_Colour; vec4 Light_Specular_Colour; float Light_Attenuation_Min; float Light_Attenuation_Max; float Light_Cone_Min; float Light_Cone_Max; }; /////////////////////////////////////////////////// // Input streams (per vertex) /////////////////////////////////////////////////// in vec3 attrib_Fragment_Normal; in vec3 attrib_Fragment_Position; in vec2 attrib_Fragment_Texture; in vec3 attrib_Fragment_Light; in vec3 attrib_Fragment_Eye; /////////////////////////////////////////////////// // Result /////////////////////////////////////////////////// out vec4 Out_Colour; /////////////////////////////////////////////////// // Main /////////////////////////////////////////////////// void main(void) { // Compute N dot L. vec3 N = normalize(attrib_Fragment_Normal); vec3 L = normalize(attrib_Fragment_Light); vec3 E = normalize(attrib_Fragment_Eye); vec3 H = normalize(L + E); float NdotL = clamp(dot(L,N), 0.0, 1.0); float NdotH = clamp(dot(N,H), 0.0, 1.0); // Compute ambient term. vec4 ambient = Material_Ambient_Colour * Light_Ambient_Colour; // Diffuse. vec4 diffuse = texture2D(Map_Diffuse, attrib_Fragment_Texture) * Light_Diffuse_Colour * Material_Diffuse_Colour * NdotL; // Specular. float specularIntensity = pow(NdotH, Material_Shininess) * Material_Strength; vec4 specular = Light_Specular_Colour * Material_Specular_Colour * specularIntensity; // Light attenuation (so we don't have to use 1 - x, we step between Max and Min). float d = length(-attrib_Fragment_Light); float attenuation = smoothstep(Light_Attenuation_Max, Light_Attenuation_Min, d); // Adjust attenuation based on light cone. float LdotS = dot(-L, Light_Direction), CosI = Light_Cone_Min - Light_Cone_Max; attenuation *= clamp((LdotS - Light_Cone_Max) / CosI, 0.0, 1.0); // Final colour. Out_Colour = (ambient + diffuse + specular) * Light_Intensity * attenuation; }

    Read the article

  • How to move a directional light according to the camera movement?

    - by Andrea Benedetti
    Given a light direction, how can I move it according to the camera movement, in a shader? Think that an artist has setup a scene (e.g., in 3DSMax) with a mesh in center of that and a directional light with a position and a target. From this position and target I've calculated the light direction. Now I want to use the same direction in my lighting equation but, obviously, I want that this light moves correctly with the camera. Thanks.

    Read the article

  • how to show all method and data when the object not has "__iter__" function in python..

    - by zjm1126
    i find a way : (1):the dir(object) is : a="['__class__', '__contains__', '__delattr__', '__delitem__', '__dict__', '__doc__', '__getattribute__', '__getitem__', '__hash__', '__init__', '__iter__', '__metaclass__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__str__', '__weakref__', '_errors', '_fields', '_prefix', '_unbound_fields', 'confirm', 'data', 'email', 'errors', 'password', 'populate_obj', 'process', 'username', 'validate']" (2): b=eval(a) (3)and it became a list of all method : ['__class__', '__contains__', '__delattr__', '__delitem__', '__dict__', '__doc__', '__getattribute__', '__getitem__', '__hash__', '__init__', '__iter__', '__metaclass__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__str__', '__weakref__', '_errors', '_fields', '_prefix', '_unbound_fields', 'confirm', 'data', 'email', 'errors', 'password', 'populate_obj', 'process', 'username', 'validate'] (3)then show the object's method,and all code is : s='' a=eval(str(dir(object))) for i in a: s+=str(i)+':'+str(object[i]) print s but it show error : KeyError: '__class__' so how to make my code running . thanks

    Read the article

  • android webView loading finished but it was a blank only I touch the screen can the content show Idont know why?and how it happened

    - by Sunday
    when my webView load this page , it was blank-page or white page only I touch the screen the content can only show private WebView webview; private ProgressDialog mProgressDialog; private Context mContext; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_web); mContext = this; webview = (WebView)findViewById(R.id.myWebView); String url = (String)getIntent().getExtras().get("url"); webview.getSettings().setJavaScriptEnabled(true); webview.setWebViewClient(new MyWebViewClient()); if(url!=null){ webview.loadUrl(url); } } class MyWebViewClient extends WebViewClient { @Override public void onPageStarted(WebView view, String url, Bitmap favicon) { super.onPageStarted(view, url, favicon); mProgressDialog = ProgressDialog.show(mContext, "tips", "wate···the view is loading", true, false); } @Override public void onPageFinished(WebView view, String url) { mProgressDialog.dismiss(); super.onPageFinished(view, url); } }

    Read the article

  • charging light on in laptop with battery removed.

    - by Jus12
    I hope this is the right place for this question. I have an LG R310 laptop. Recently the adapter connector started playing up, so I got a second hand replacement adapter of the same rating. The adapter was a cheap type (I know I made a mistake) and faulty.. it made a low buzzing sound when plugged in and not connected to the laptop. It didn't make the noise when connected to the laptop. Foolishly I used this adapter for several weeks. One day the adapter stopped working. The led didnt work and it was not charging. It had also drained the laptop's battery to 0%. I then got an original replacement adapter. Now I can use the laptop on power but the battery does not charge. The charging light does not come on. The interesting thing is that when I remove the battery the charging light comes on and stays on after I insert the battery back (the battery still does not charge). I need to know if the faulty adapter damaged the motherboard or if its just a problem with the battery. I have a multimeter and I prefer not to open the laptop. Thanks in advance.

    Read the article

  • Looking for a "light" compositing manager for GNOME

    - by detly
    I have an HP Pavilion DM3 (graphics is nVidia GeForce G105M), running Debian Squeeze with GNOME 2.30. My preference for DE is Gnome + Metacity + Nautilus. I'd like to use Docky, but it requires compositing. So I'm looking for a relatively "light" compositing manager. I realise that "light" is ambiguous, but I basically want something that won't chew through my notebook's batteries because of CPU or GPU usage. I know that Metacity is capable of compositing, but as far as I'm aware it's still testing. Some people report that it's smooth and lightweight, others claim that it eats up processor time. I've also seen references to a problem with nVidia, but no actual details. I'm not averse to Compiz, but I haven't used it before and I don't know what to expect in terms of "weight." And maybe there's something else I haven't heard of. So can anyone recommend anything? Or dispel my idea that Metacity is not the right tool for the job? (Originally posted on GNOME forums.)

    Read the article

  • Power supply switch like stays off motherboard light turns on

    - by Sion
    I bought a computer at the thrift store yesterday. The computer powered on without any error beeps. Getting it back to the house determined that the CD and hard drive needed to be changed. Put in a populated hard drive to check, the computer turned on and seemed to function. Put in a new CD drive, and just put in a new Hard drive. I plugged it in to check and I noticed that the light for the power supply switch did not come on. But I did notice that the light on the motherboard is lit. and I could not turn the computer on. To help troubleshoot it I unplugged the CD and Hard drive. then re-plugged the power supply and switched it on and off. Nothing changed. Parts: Motherboard: Digital Home PSW DH deluxe Power Supply: FSP-Group FX700-GLN Did I accidentally unplug something while installing the hard drive? Is the Power supply fried somehow?

    Read the article

  • Light Blue Monitor Screen

    - by SixfootJames
    I have seen this before with an older monitor that over time, the monitor colours change to a light blue haze. This has started happening with an older monitor of mine now (A GigaByte Monitor) and although none of the pins are bent and it's a brand new machine, there is no reason, other than aging that it should show the light blue screen. Perhaps it is just time for a new monitor, but if there is a way of saving it still. I would appreciate the insight. Perhaps there is something I have not tried, perhaps it has something to do with the new machine instead of the monitor? I had the monitor plugged into two other machines over the weekend and didn't have this problem. So I am not quite sure what to make of it. Many thanks! EDIT: I must also add that when I plugged the monitor into the older machines, I had the VGA converter attached to the end of the newer DVI output. Which, when plugged into the newer PC, I don't need of course.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >