VeTaL Posted July 1, 2011 Share Posted July 1, 2011 Found old thread and wanted to make Area light and share it for community, but new version is differs from last one It's already supported. Uncomment line 343 of shaders\lighting\pointlight.frag: //ambient = gl_LightSource[0].diffuse * (1.0-falloff) * 0.25 * diffuse; Now, pointlight.frag consists of 122 lines Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
macklebee Posted July 1, 2011 Share Posted July 1, 2011 try replacing the last line: gl_FragData[0] = (lightcolor * diffuse * attenuation * shadowcolor) + (specular * shadowcolor); with this: ambient = gl_LightSource[0].diffuse * (1.0-falloff) * 0.25 * diffuse; gl_FragData[0] = ambient + (lightcolor * diffuse * attenuation * shadowcolor) + (specular * shadowcolor); Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
VeTaL Posted July 1, 2011 Author Share Posted July 1, 2011 The problem is that i cant find linking between light and shader. So, i created copy of Leadwerks Engine SDK\Models\Entities\Light\Point\ and called it Leadwerks Engine SDK\Models\Entities\Light\PointArea\ then i renamed all files into light_pointArea now i'm searching for linking with pointlight.frag (i want to create pointlightarea.frag), but total commander says that there is no text "pointlight.frag" in folder Leadwerks Engine SDK\Models\Entities\ Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
VeTaL Posted July 1, 2011 Author Share Posted July 1, 2011 Got a crash.. working on it Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
VeTaL Posted July 1, 2011 Author Share Posted July 1, 2011 vec4 ambient = gl_LightSource[0].diffuse * (1.0-falloff) * 0.25 * diffuse; gl_FragData[0] = ambient + (lightcolor * diffuse * attenuation * shadowcolor) + (specular * shadowcolor); Thats ok. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.