Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (711)
Games in Android Showcase (213)
games submitted by our members
Games in WIP (785)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Transparency and Lighting  (Read 1704 times)
0 Members and 1 Guest are viewing this topic.
Offline kevglass

« JGO Spiffy Duke »

Medals: 319
Projects: 25
Exp: 22 years

Coder, Trainee Pixel Artist, Game Reviewer

« Posted 2003-11-22 07:12:25 »

Do these two things work together currently?

I'm finding if I enabled lighting on a material for an appearance the transparency settings have no effect.

Any help appreciated,


Offline Preston

Senior Devvie

Medals: 4

« Reply #1 - Posted 2003-11-22 09:05:21 »

Well, I think I can help with a Xith3d question - for the very first time. :-)
Basically the same question I've asked some days ago, but unfortunately I've hidden it in another poster's thread, so it's hardly noticeable.
Please have a look at here:;action=display;num=1067981426;start=15

The exact technical details have been revealed by Yuri in the linked thread. However, because the topic really fits better to your new thread here, please let me quote Yuri's two main articles:

Well, some points on alpha blending.

There is no bug in this functionality, but this is a bit incompatible with Java3D. I just committed new test - - to CVS.

You should use setColorTarget(...) on your material to get transparency working in some (most) cases. The reason for this is that Java3D-style material accepts 3-component colors only, so for now material shader sets alpha to opaque. If you specify color target, appropriate material color will be replaced with color from coloring attributes/vertex colors/transparency attributes.

This is still not clear of what to do with this incompatibility, and I personally prefer to go to more advanced Material that will support different front/back materials and 2-sided lighing model, as well as more sophisticated light control.

From Java3D docs:

In Xith3D, if no vertex colors present, the color combined from ColoringAttributes and TransparencyAttributes used as a vertex color and set to be same for all vertices.

Also note that default color target in Java3D is DIFFUSE and in Xith3D is NONE.


P.S. There is also JavaDoc comments for this method/constants in Xith3D
Offline kevglass

« JGO Spiffy Duke »

Medals: 319
Projects: 25
Exp: 22 years

Coder, Trainee Pixel Artist, Game Reviewer

« Reply #2 - Posted 2003-11-22 09:34:11 »

Doh! Thanks alot Preston!

I actually read the post and totally forgot about it. Thanks again thats done the trick..

My lovely teleport effect works again.


Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Preston

Senior Devvie

Medals: 4

« Reply #3 - Posted 2003-11-25 15:52:18 »

Always light on in the following. :-)
Is it possible to create a per vertex coloured Shape3D without having to use COLOR_4 ?
For example there's a a per vertex coloured Shaped3 of type COLOR_3 and it shall be made transparent with one value (50% for example), like using "tansparency.setTransparency(0.5f)". This just works for Shape3ds without any COLOR_x in the geometry.
With COLOR_4 the appeareance.setTransparency(value) is being ignored or rather overwritten by the per vertex colours' alpha value. While this works fine and allows a good fine tuning of the transparency per vertex, like here:
IndexedTriangleArray geo = new IndexedTriangleArray(vertices.length, GeometryArray.COORDINATES | GeometryArray.COLOR_4 | GeometryArray.NORMALS, polygonindices.length);

Appearance ape = new Appearance();
Material material = new Material();

TransparencyAttributes transp = new TransparencyAttributes();
transp.setTransparency(0.5f); // is being overwritten by the vertex colours' alpha values

Shape3D korpus = new Shape3D(geo, ape);

I wonder if there's a simpler way to achieve a transparent coloured Shape3d whit one Transparency-value...?
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

numerical (274 views)
2017-02-21 07:32:16

numerical (272 views)
2017-02-21 07:31:46

theagentd (384 views)
2017-02-18 13:42:33

theagentd (383 views)
2017-02-18 13:35:16

h.pernpeintner (1550 views)
2017-01-24 22:39:11

h.pernpeintner (1537 views)
2017-01-24 22:38:32

Galdo (2101 views)
2017-01-12 13:44:09

Archive (2101 views)
2017-01-02 05:31:41

0AndrewShepherd0 (2637 views)
2016-12-16 03:58:39

0AndrewShepherd0 (2346 views)
2016-12-15 21:50:57
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!