Login Action Required

The NinevehGL Forum uses a new concept of "socialized forum" or as we like to say "Tweet Forum".


Here is the deal:
  1. No new registration is required. Just sign in with your Twitter account and authorize the NinevehGL Forum.
  2. Once you’re in, you'll be able to "Follow a Thread", that means every time that thread receive a new post or update you'll receive a mention on your twitter.
  3. Besides, you can enable "Auto Share", then every new post and/or thread you make will be tweeted on your timeline. (By default, auto-share is enabled only for your threads)

Forum Rules:

1. We understand human comunication can become "hot" sometimes. So some insults and bad words ARE allowed. Just don't push too much being an asshole all the time.

2. SPAMMERS are not allowed. There are penalties for this kind of user and they can be banned forever.

3. You can report other users, if you judge necessary. An user reported many times by many people can also be banned forever. However you can also receive penalties for report deliberately for no apparent reason.

If there is a similar thread title, make sure the other one doesn't already have the answer you're looking for.

This forum uses the BBCode (Bulletin Board Code), here are some instructions:

Bold: [b]text[/b]
Italic: [i]text[/i]
Underline: [u]text[/u]

Code: [code]text[/code]
Quote:
[quote=@username]text[/quote]
[quote]text[/quote]

List:
[ul] [*]item [/ul]
[ol] [*]item [/ol]

URL:
[url]http://url.com[/url]
[url=http://url.com]text[/url]

Image:
[img]http://imageurl.com[/img]

Embed (videos, code, 3D):
[embed]http://url.com[/embed]

Welcome to the NinevehGL's world!
NinevehGL is a 3D engine forged with pure Obj-C.
Welcome to the
Forum!
Hello, Guest.

Your current vote:

You can change your vote many times. But it's still one single vote.

Lights and scaling
Vote this thread:


@Climbatize84

Posts: 13

NGLNewbie

Wed, Aug 8 2012


Hi there!

New day, new question

I have a problem with light when I rescale my big big meshes: shadows don't appear, and untextured meshes appear black. I tried scaling/moving the default light (which is turned on), but nothing happens. With the same params, loading meshes with a normalization is ok (shadows and lightning are good), but what's wrong with my light when I downscale instead of normalize?
0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Wed, Aug 8 2012


In response to: @Climbatize84

In response to: @Climbatize84

Hello buddy,

This happen in reason of your mesh position. Even without the normalization feature, could be good to use the "centralize" feature to make sure your mesh is in the center of the world.

Besides, by default the main light has attenuation factor of 1.0. You can increase this value to minimize the effects of dark areas.

But my advice is if you don't need the light at all, just turn it off:

nglGlobalLightEffect(NGLLightEffectOFF);
nglGlobalFlush();


BTW, answering your other question, you can rescale an entire group if you place your meshes inside a group and use the NGLGroup3D scale property to adjust the size.
0% like this - 0/0

@Climbatize84

Posts: 13

NGLNewbie

Wed, Aug 8 2012


@dineybomfim said:


In response to:@Climbatize84

Hello buddy,

This happen in reason of your mesh position. Even without the normalization feature, could be good to use the"centralize" feature to make sure your mesh is in the center of the world.



I can't really centralize, because my meshes all have a relative position to each other. If I centralize, they all loose their relative position.

@dineybomfim said:



Besides, by default the main light has attenuation factor of 1.0. You can increase this value to minimize the effects of dark areas.



Yep, I changed it and it somehow works, but attenuation is limited to 1000, which is not enough in my case, I have a sort of spot of light

@dineybomfim said:



But my advice is if you don't need the light at all, just turn it off:

nglGlobalLightEffect(NGLLightEffectOFF);
nglGlobalFlush();




Yes I know, but light is essential here, or my textures are burnt

@dineybomfim said:



BTW, answering your other question, you can rescale an entire group if you place your meshes inside a group and use the NGLGroup3D scale property to adjust the size.


Yes it's what I do, but I think scaling is not working properly, in fact I have to change attenuation of my light to 1000 and position it to 1500,3000 to have something not too black, but I would need more attenuation. When I use the normalization, light is ok, shouldn't it work like scaling?
0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Thu, Aug 9 2012


In response to: @Climbatize84

Dude... you really need to downscale this mesh inside the 3D software..

3000?

Wow... remember that OpenGL has precision pointer... many of them are lowp, that means a range of [-2.0, 2.0]... you can really have problems in the future with this and performance problems.

Remember that developing to mobile means you ALWAYS need to use game techniques, optimizing everything.
0% like this - 0/0

@Climbatize84

Posts: 13

NGLNewbie

Thu, Aug 9 2012


@dineybomfim said:


In response to:@Climbatize84

Dude... you really need to downscale this mesh inside the 3D software..

3000?

Wow... remember that OpenGL has precision pointer... many of them are lowp, that means a range of[-2.0, 2.0]... you can really have problems in the future with this and performance problems.

Remember that developing to mobile means you ALWAYS need to use game techniques, optimizing everything.

Yeah I know, I know, but I thought it was interesting keeping the original modele as it, because we use it here for other projects

Thanks answering my nonesense questions, I will ask my 3D artist to downscale all

But performances ore really good indeed, 140299 polys, 91521 verts, anitaliasing 4x, no texture compression and trilinear quality with light effects ON -> 50FPS.

I will ask my boss if he'd like considering make a donation
0% like this - 0/0

@bhartiya_varun

Posts: 27

NGLNewbie

Fri, Nov 2 2012


In response to: @dineybomfim

Hello,

I have meshes of size around 0 to 255 and I have them in NGLGroup3D. I did write some code to find the bounding box of group and then scale the entire group together to fit within range 0 to 1.

But unfortunately, everything still appears dark.. If I set light at 200,200,200 and set attenuation around 300, I see the meshes nicely..

How did I check if my models are getting scale correctly? I loaded few other meshes and placed them around 1,1,1 to cross check.. Also my camera is positions at 0,0,2.5..

So I think scaling is working properly.

But still I am unable to control the light effect..

Turning the light effects completely OFF

nglGlobalLightEffects(NGLLightEffectsOFF);
nglGlobalFlush();

does not work for me. I think I need light effects.

Could you please help?

Regards
0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Sat, Nov 3 2012


In response to: @bhartiya_varun

Make a NSLog(@"%@") in your mesh. NGLMesh is properly tell you all the parameters of the mesh, so you can check if it's something related to the texture/material or light.
0% like this - 0/0

@bhartiya_varun

Posts: 27

NGLNewbie

Mon, Nov 5 2012


In response to: @dineybomfim

I could not get all the properties for mesh printed at once.. I had to use NSLog for all the properties separately.


Group3d of meshes is scaled, but still light needs to be placed at far off distance like 200,200,200 or i have to set attenuation far greater than 1 to see the mesh correctly.

Is scaling of mesh and light related someway?

0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Mon, Nov 5 2012


In response to: @bhartiya_varun

Why do you can't NSLog your NGLMesh? It'll show you all that you need.

You can turnoff the global light using nglGlobalLightEffects(NGLLightEffectsOFF); for testing purposes.
0% like this - 0/0
Technology

NinevehGL is a 3D engine built right on top of OpenGL ES and it uses all the programmable pipeline power, making it easy for you to create great application with shaders.

Share on


Follow NinevehGL
Fastest way to contact us:

Copyright © 2011 db-in. All rights reserved.