Another WIP using G3D9

74 views
Skip to first unread message

EdwardP

unread,
Feb 1, 2013, 5:31:17 PM2/1/13
to g3d-...@googlegroups.com
Got an implementation of the 3D radar like the one implemented in the original Elite working this evening. It was really pretty straightforward thanks to G3D::CoordinateFrame doing all the hard work for me!

Thought some might be interested: http://www.youtube.com/watch?v=L9O8RUk4CLk

Cheers

E

Morgan McGuire

unread,
Feb 1, 2013, 7:08:12 PM2/1/13
to g3d-...@googlegroups.com
Nice. I like the radar and the lighting.

-m

Prof. Morgan McGuire
Computer Science Department
Williams College
http://cs.williams.edu/~morgan
> --
> You received this message because you are subscribed to the Google Groups
> "G3D Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to g3d-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

EdwardP

unread,
Feb 2, 2013, 4:00:38 AM2/2/13
to g3d-...@googlegroups.com
Thanks Morgan, the lighting is currently just the default one I've set up for the base GameScreen class, but it is based on this article from the lead XNA developer:


If others are interested, the code is:

void GameScreen::CreateDefaultLighting(int brightness_factor)
{
   // Key light
   m_lighting->lightArray.append(Light::directional("key", Vector3(1.5, 2, 1), Color3::fromARGB(0xFFB2D1DC) * (float)brightness_factor, false));

   // Fill light
   m_lighting->lightArray.append(Light::directional("fill", Vector3(-1.5, -2, 1), Color3::fromARGB(0xFFe0cc9b) * (float)brightness_factor, false));

   // Back light
   m_lighting->lightArray.append(Light::directional("back", Vector3(0, -0.5, -1), Color3::fromARGB(0xFFB2D1DC) * (float)brightness_factor, false));
}

you'll notice that I have added a 'brightness_factor' to multiply-up the colour values. I found I need to do this in pretty much all cases to get the models lit adequately - is this something you'd expect, or is it (as I suspect) a problem with my model material definitions? The thing is that my models have come from a variety of sources and I would be surprised if they were all wrong?

E

Morgan McGuire

unread,
Feb 2, 2013, 9:15:41 AM2/2/13
to g3d-...@googlegroups.com
G3D's lighting model is physically based, so there's no reason to
think that "1 W/m^2" is a good value to avoid saturating or
underexposing the image. I think that it happens to work out so that
is actually a reasonable value, but I'm not sure. It might just be
that your textures are too dark or that you don't have a bright enough
environment map.

I've switch to almost always using spot lights instead of directional
lights. There I have some intuition for the values (which are in
watts) and they tend to act more predictably in hybrid renderers. For
a space game, the lighting has to be all fake anyway (things are too
bright or too dark in real outer space) so what you're doing is
probably the best design.

-m

Prof. Morgan McGuire
Computer Science Department
Williams College
http://cs.williams.edu/~morgan


bmbsage

unread,
Feb 12, 2013, 9:00:24 AM2/12/13
to g3d-...@googlegroups.com
Morgan Great job on your work in G3d....!!

I wish i had the time to put together something like this magnitude..
I'm really thinking about leveraging it for a project I'm working on...
Have you tried porting it to Android yet?


Brian
Reply all
Reply to author
Forward
0 new messages