svg实现夜晚探照灯照射石子逼真灯光效果代码
代码语言:html
所属分类:其他
代码描述:svg实现夜晚探照灯照射石子逼真灯光效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!doctype html> <html> <head> <meta charset="utf-8"> <title></title> <style> html, body { height: 100%; margin: 0; } svg { display: block; } </style> </head> <body> <svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <filter id="light"> <!-- blur the source image to make bump map less sharp --> <feGaussianBlur stdDeviation="3" result="blurred"></feGaussianBlur> <!-- create bump map based on alpha channel --> <feColorMatrix in="blurred" type="luminanceToAlpha" result="bumpMap"></feColorMatrix> <!-- use bump map for lighting filter --> <feDiffuseLighting in="bumpMap" surfaceScale="3" result="light"> <fePointLight x="225" y="150" z="30"></fePointLight> </feDiffuseLighting> <!-- compose the lighting result with source image using multiplication --> <feComposite in="light" in2="SourceGraphi.........完整代码请登录后点击上方下载按钮下载查看
网友评论0