Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (756)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
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  
  viewing translucent polygons from behind (color is too dark)  (Read 1258 times)
0 Members and 1 Guest are viewing this topic.
Offline keith_myers

Senior Newbie





« Posted 2006-03-07 20:16:14 »

I've been messing around for several hours trying to get a simple translucent polygon to look correct from both sides.  It's fine from the front, and blending works as expected.  In fact if I put several in a row the 'add' correctly.  If I move the camera around to the back and look toward the light source through the polygons they are dark for obvious reasons.

So, how might I convince the polygon to behave as you would expect a pane of glass to behave in a window?  It seems as long as I have lighting enabled when I draw the poly it will never look right, but if lighting is off you cant see it at all...

I can put some code up if needed, and thanks for any input.

Keith
Offline GKW

Senior Devvie




Revenge is mine!


« Reply #1 - Posted 2006-03-07 21:22:26 »

glLightModeli( GL.GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE );

I don't know if that will work for you or not.
Offline keith_myers

Senior Newbie





« Reply #2 - Posted 2006-03-08 02:13:19 »

That was one of the things I tried, unfortunately.  It supplied a partial fix by at least allowing you to SEE the poly from the back, but then the lighting was too dark because, of course, the light source was shining on the front face.  I'm imagining a stained glass window with the sun shining on it... it's well lit from the front AND back. 
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline dawidl

Senior Newbie





« Reply #3 - Posted 2006-03-20 10:54:41 »

I think you are trying to accomplish something quite complex, translucency with correct lighting from the back is incredibly computationally expensive, and is only quite recently implemented in the renderers of 3D Modeling apps, such as 3D Studio Max, Blender, Maya, etc. Corrct me somebody if I'm wrong, but I don't think there's any way OpenGL can give you this effect (the physically correct calculation of photons as they pass through a translucent surface) "for free" - I imagine you'd have to simulate it with more lights on the other side of the glass, or by tweaking the material.

Dawid
Pages: [1]
  ignore  |  Print  
 
 

 
DesertCoockie (56 views)
2018-05-13 18:23:11

nelsongames (88 views)
2018-04-24 18:15:36

nelsongames (78 views)
2018-04-24 18:14:32

ivj94 (763 views)
2018-03-24 14:47:39

ivj94 (95 views)
2018-03-24 14:46:31

ivj94 (647 views)
2018-03-24 14:43:53

Solater (108 views)
2018-03-17 05:04:08

nelsongames (189 views)
2018-03-05 17:56:34

Gornova (430 views)
2018-03-02 22:15:33

buddyBro (1090 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
java-gaming.org 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‑gaming.org
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!