Triangle mesh and light

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
naku
Posts: 3
Joined: Thu Aug 26, 2010 11:27 pm

Triangle mesh and light

Post by naku »

Hi!

I see that my triangle mesh textured terrain doesn't have any light reflected... but when I create one entity box it apears with reflected light..

Code: Select all

            var test1 = game.Content.Load<Model>("road2");
                   var uva2 = new DisplayEntityModelTest(acceptedTrigger, test1, game.ModelDrawer);
                   uva2.Entity.IsAffectedByGravity = false;
                   game.ModelDrawer.Add(uva2);    

Can I put some code for solve this?

Thanks!

P.D: I'm still learning.. :P
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Triangle mesh and light

Post by Norbo »

This is just because of the different ways things are rendered. The BEPUphysicsDrawer has some hardcoded directional lighting. Some other things might be using the BasicEffect, which probably has default lighting enabled (which looks different).

However, the BEPUphysics engine doesn't manage anything on the graphics side of things; if you're looking for graphics or general development information, the xna website (http://creators.xna.com/) would be the best place to start. There's lots of samples and information on there (and in the forums).
naku
Posts: 3
Joined: Thu Aug 26, 2010 11:27 pm

Re: Triangle mesh and light

Post by naku »

Thanks for fast reply!

it's rare..

this have light

Code: Select all

var fish = game.Content.Load<Model>("fish");
           game.ModelDrawer.Add(new DisplayEntityModelTest(acceptedTrigger, fish, game.ModelDrawer));
but another one no..

Code: Select all

var fish = game.Content.Load<Model>("my_test_fish");
           game.ModelDrawer.Add(new DisplayEntityModelTest(acceptedTrigger, fish, game.ModelDrawer));
maybe a problem with blender/blender exporter?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Triangle mesh and light

Post by Norbo »

It would seem that it has something to do with the content itself and how it sets up something with the drawer, yes.

As I always warn people though, the BEPUphysicsDrawer is meant for drawing demos and for debugging simulations. Trying to use it for a game usually just ends up causing pain.
naku
Posts: 3
Joined: Thu Aug 26, 2010 11:27 pm

Re: Triangle mesh and light

Post by naku »

ok thanks for answers!
Marvin
Posts: 32
Joined: Wed Aug 04, 2010 9:16 pm

Re: Triangle mesh and light

Post by Marvin »

I just draw my terrain seperately instead of drawing the triangle mesh (this also looks much smoother). I only add the model triangle mesh to the space and add the same model straight to my own drawer which is just the basic code from msdn, this works fine. if you need an example of how my code looks, just ask.
Post Reply