- This topic has 7 replies, 7 voices, and was last updated 4 years ago by
jdhutchinson.
-
AuthorPosts
-
2020-07-30 at 6:02 am #30896
core3d
CustomerOK here you go;
1. You need Lensflare.js in you app directory.
Lensflare.js2. Enable your app to import modules in your myapp.html file.
<script src="v3d.js"></script> <script type="module" src="myapp.js"></script>
3. Import Lensflare module to your myapp.js file.
import * as verge from '../../build/v3d.module.js'; import { Lensflare, LensflareElement } from './Lensflare.js';
This needs to be on top of your file after “use strict” line.
4. Add an omnilight on your scene as “Omni001” in your 3D application (blender or max or maya)
5. Add lensflare textures on your app directory inside (../textures/lensflare/).
6. Add lensflare code to your runcode section.
var textureLoader = new v3d.TextureLoader(); var textureFlare0 = textureLoader.load('textures/lensflare/lensflare0.png'); var textureFlare3 = textureLoader.load('textures/lensflare/lensflare3.png'); var light = app.scene.getObjectByName('Omni001'); var lensflare = new Lensflare(); lensflare.addElement(new LensflareElement(textureFlare0, 700, 0, light.color)); lensflare.addElement(new LensflareElement(textureFlare3, 60, 0.6)); lensflare.addElement(new LensflareElement(textureFlare3, 70, 0.7)); lensflare.addElement(new LensflareElement(textureFlare3, 120, 0.9)); lensflare.addElement(new LensflareElement(textureFlare3, 70, 1)); light.add(lensflare);
Thats all.
Happy lensflaring.
Thanks to zjbcool for his awesome example about importing modules.2020-07-30 at 7:32 am #30914Yuri Kovelenov
Staff2020-07-30 at 11:12 am #30926web
CustomerThx you very much for that write up. This is pure gold.
2020-07-31 at 1:32 am #309472020-08-15 at 11:57 am #31580visualizer
CustomerWow
looks interesting !can you provide a simple example file as well?
For newbie & no programmer like me it would be great guide.Its really nice idea
you shared here !
2021-03-12 at 9:43 am #39421gf3d
CustomerHi there, i´ve been using this and it works fine…..
The only thing!!!!
the flare disappear when behind 3d objects in the scene….
I know this is what flares should do…..but is there a way to
prevent them from doing this?Greets
Ger
2021-08-06 at 12:24 pm #43483jdhutchinson
CustomerDoes this require the Enterprise version of Verge?
In reference to the line:
import * as verge from '../../build/v3d.module.js';
2021-08-24 at 1:41 am #43939jdhutchinson
Customeri Couldn’t add the build v3d module line
-
AuthorPosts
- You must be logged in to reply to this topic.