www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: ggp on February 17, 2012, 07:45:08 pm

Title: How to make the light glow of the example AnD3Bench?
Post by: ggp on February 17, 2012, 07:45:08 pm
How to make the light glow of the example "Multiple light sources" AnD3Bench?



Title: Re: How to make the light glow of the example AnD3Bench?
Post by: Thomas. on February 17, 2012, 08:39:11 pm
It is just billboarded plane on light position
Title: Re: How to make the light glow of the example AnD3Bench?
Post by: EgonOlsen on February 17, 2012, 08:41:05 pm
...with additive blending.
Title: Re: How to make the light glow of the example AnD3Bench?
Post by: ggp on February 17, 2012, 08:51:51 pm
Thank you.
Title: Re: How to make the light glow of the example AnD3Bench?
Post by: ggp on February 18, 2012, 02:04:08 pm
Billboarding - OK.

TextureManager.getInstance().addTexture("glow", new Texture(res.openRawResource(R.raw.glow), true));
            glowPlane = new Object3D(dummyPlane, true);
            glowPlane.setTexture("glow");
            glowPlane.setAdditionalColor(RGBColor.WHITE);
            glowPlane.setLighting(Object3D.LIGHTING_NO_LIGHTS);
            glowPlane.setTransparency(7);
            glowPlane.setBillboarding(true);
            glowPlane.shareCompiledData(dummyPlane);
            glowPlane.build();
            glowPlane.strip();
                               
                               light= new Light(world);
                light.setIntensity(250, 250, 250);
                               SimpleVector sv = new SimpleVector();
            sv.set(fuente.getTransformedCenter());
            sv.x = 0;
            sv.y = -50;
            sv.z = 40;
            light.setPosition(sv);
                               
                               world.addObject(glowPlane);

additive blending? code example please. I can not find.
Title: Re: How to make the light glow of the example AnD3Bench?
Post by: K24A3 on February 18, 2012, 04:04:29 pm
myObject3D.setTransparencyMode(Object3D.TRANSPARENCY_MODE_ADD);