![]() |
|
|||||||
| Feature Discussion Education, discussion and proposals of WWJ features |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Jun 2007
Posts: 98
![]() |
I would like to see some minimalistic access to adjust lighting. For now I have modified SurfaceTileRenderer with the following. It would be nice to have a setAmbientLighting method or something like that....
Code:
private float[] light_colors1 = { 3.0f, 3.0f, 3.0f, 1.0f};
private java.nio.FloatBuffer light_col_ambient = java.nio.FloatBuffer.wrap( light_colors1 );
//lighting
gl.glEnable(GL.GL_LIGHTING);
gl.glLightfv(GL.GL_LIGHT1,GL.GL_AMBIENT, light_col_ambient);
gl.glLightModelf(GL.GL_LIGHT_MODEL_AMBIENT,1.0f);
gl.glEnable(GL.GL_LIGHT1);
gl.glTexEnvi(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_COMBINE);
|
|
|
|
|
|
#2 |
|
Senior Member
Join Date: May 2007
Location: Milan, Genoa (Italy)
Posts: 112
![]() |
Can you post a screenshot? I'm curious about the result.
__________________
-- Fabrizio Giudici, Ph.D. - Java Architect, Project Manager Tidalwave s.a.s. - "We make Java work. Everywhere." weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog Fabrizio.Giudici@tidalwave.it - mobile: +39 348.150.6941 |
|
|
|
|
|
#3 |
|
Member
Join Date: Jun 2007
Posts: 98
![]() |
Sure, here is a post I made before. The lighing with settings of about 1.0f I think....
|
|
|
|
|
|
#4 |
|
Member
Join Date: Jun 2007
Posts: 98
![]() |
Maybe a more flexible approach would be to implement the multi-texturing for tiles in a fragment shader as the comments in the source code elude to. I tried doing this with some success. I could pass in a sampler2D and get the tiles to draw, but I could not figure out how to the get alpha masking to work via a second texture unit. It does make drawing borders around the tiles extremely easy. This would also allow all kinds of really cool stuff like real-time color interpolated overlays like surface temperature for example.
After thinking about this more, it seems like just simple control over ambient lighting is not enough. For night simulations, you might want to have some kind of directional lighting for example. I'm not suggesting that this should all be implemented in the core, but It seems like there has to be some clean way of implementing these things without requiring the SDK user to modify the core code. Just some thoughts... Last edited by tve; 06-17-2007 at 04:08 PM. |
|
|
|
|
|
#5 |
|
WWJ Consultant
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
![]() |
You need normals for the terrain vertices to get proper lighting/shading.
Not done yet. |
|
|
|
|
|
#6 | |
|
Member
Join Date: Jun 2007
Posts: 98
![]() |
Quote:
![]() |
|
|
|
|
|
|
#7 |
|
WWJ Consultant
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
![]() |
It sounds very interresting... i should look into shaders
![]() What version of GPU shaders support would you need for this ? |
|
|
|
|
|
#8 |
|
Member
Join Date: Jun 2007
Posts: 98
![]() |
deleted
Last edited by tve; 07-02-2007 at 03:34 AM. |
|
|
|
|
|
#9 | ||
|
WWJ Consultant
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
![]() |
Quote:
![]() Quote:
I'll have a look at your shader test bench... after i retire that aging GeForce4 MX i'm using. I'm a bit lagging on the hardware these days ![]() |
||
|
|
|
|
|
#10 |
|
Worldwind Developer
Join Date: Jan 2006
Location: Hobart, Australia
Posts: 754
![]() |
Playing with shaders again not sure how to attach a texture to a named uniform sampler.
__________________
Coding This and That in World Wind and helping new people out, as long as they don't pester too much. Currently blogging at: http://whatnicklife.blogspot.com Working at: Aerometrex - http://aerometrex.com.au/blog/ Impact so far: ![]() |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Two suggestion for the online xml files | Guest_Jim_* | Suggestion Box | 2 | 04-26-2007 11:36 PM |
| Running without the DirectX SDK | bbreck | Developers' Corner | 10 | 02-07-2007 06:01 AM |
| a suggestion for the forums | PostFatal_ | Suggestion Box | 9 | 12-04-2006 10:00 PM |
| Suggestion re 1.4 warnings and key chart | nlneilson | Suggestion Box | 1 | 11-25-2006 04:14 AM |
| Plug-In using C++ SDK | James_In_Utah | Developers' Corner | 1 | 11-05-2006 03:32 PM |