Page 1 of 1
Triangle mesh and light
Posted: Thu Aug 26, 2010 11:35 pm
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..

Re: Triangle mesh and light
Posted: Thu Aug 26, 2010 11:42 pm
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).
Re: Triangle mesh and light
Posted: Thu Aug 26, 2010 11:54 pm
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?
Re: Triangle mesh and light
Posted: Fri Aug 27, 2010 12:00 am
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.
Re: Triangle mesh and light
Posted: Fri Aug 27, 2010 12:03 am
by naku
ok thanks for answers!
Re: Triangle mesh and light
Posted: Tue Aug 31, 2010 11:41 am
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.