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.

Issue with lighting
Vote this thread:


@Momeks

Posts: 71

NGLSpecialist

Thu, Nov 28 2013


Hi , I am trying to achieve best lighting effects on an object , so here is my issue with NinevehGL's lighting ...

If turned NGLLightEffectsOFF the object is too dark ! :



and when turn in on it's too brightness and feels 2D :




I need something like this :



in that case NGLLightEffects is OFF but still there is shadow beneath object , is it possible to achieve this result ??

0% like this - 0/0

@Momeks

Posts: 71

NGLSpecialist

Thu, Nov 28 2013


Image link broken :

0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Thu, Nov 28 2013


In response to: @Momeks

Hello Momeks,

You're just think about the light, but remember that the light it self is just one final component of the look of your mesh. The biggest point is all about the materials, they are the responsible for look.

Based on what you said, seems you want a smallest "shininess" (http://nineveh.gl/docs/Classes/NGLMaterial.html#//api/name/shininess)
Seems you need 0 or something near to 0.
0% like this - 0/0

@Momeks

Posts: 71

NGLSpecialist

Fri, Nov 29 2013


In response to: @dineybomfim

Thanks , but the object goes white !!!




NGLMaterial *material = [NGLMaterial material];
[material setShininess:2];
_mesh.material = material;
[_mesh compileCoreMesh];
0% like this - 0/0

@Momeks

Posts: 71

NGLSpecialist

Fri, Nov 29 2013


It solved by adding a map ! but still that's not what I want .



just how can I turn lights OFF , but still add some shadow . that's all what I want.


what about NGLLightValues ? (I don't know how to use it)

0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Fri, Nov 29 2013


In response to: @Momeks

No, no, no, buddy....

Look, with these lines:


NGLMaterial *material = [NGLMaterial material];
[material setShininess:2];
_mesh.material = material;
[_mesh compileCoreMesh];


You're setting a completely new material, which has no textures on it...

Remember, when you load a 3D file, it'll load the material inside the 3D file. Follow these steps:
1 - Implement a mesh delegate.
2 - On the "meshLoadingDidFinish" your mesh is completely loaded, including its materials.
3 - Inside this method, you can retrieve the mesh.material. This property will return a NGLMaterialMulti, then you loop through the materials and change the shininess of each one.

Did you get it?

0% like this - 0/0

@Momeks

Posts: 71

NGLSpecialist

Fri, Nov 29 2013


In response to: @dineybomfim

Thanks but I think it gives the same result , here what I did :


- (void) meshLoadingDidFinish:(NGLParsing)parsing
{

_progress.progress = parsing.progress;
[_progress removeFromSuperview];


NGLMaterial *material = [NGLMaterial material];
[material setShininess:1.9];
[_mesh compileCoreMesh];

}


I am sure it's wrong way but would you please give me an sample code ? I don't know how to work NGLmaterialMulti and looping with it !
0% like this - 0/0

@Momeks

Posts: 71

NGLSpecialist

Tue, Dec 3 2013


I am still waiting for a solution I would be grateful for any help
0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Tue, Dec 3 2013


In response to: @Momeks

Hello buddy,

See, you're creating a new instance of a NGLMaterial that has nothing to do with the loaded mesh.

-(void) meshLoadingDidFinish:(NGLParsing)parsing
{
NGLMaterial*material=[NGLMaterial material];
[material setShininess:1.9];
[_mesh compileCoreMesh];
}


You should go this way:


-(void) meshLoadingDidFinish:(NGLParsing)parsing
{
NGLMateiralMulti*materialLib = (NGLMateiralMulti*)[_mesh material];
NGLMaterial*material= nil;

for(material in materialLib)
{
[material setShininess:1.9];
}

[_mesh compileCoreMesh];
}
100% like this - 1/1

@Momeks

Posts: 71

NGLSpecialist

Tue, Dec 3 2013


In response to: @dineybomfim

Thanks , but I think I have to control the light not shines , because the object is still dark . in this image I turned the light OFF , and added a shadow with Photoshop

[img]http://appersian.net/upcenter/images/screen_shot_2013-11-28_at_11.14.09_pm-1385668504.png
[/img]

I need something exactly like this image . how should I change lighting options ? because doing like this :

  NGLLight *light = [NGLLight defaultLight];
[light lookAtObject:_mesh];
[light setAttenuation:1000.0];


doesn't change anything , thank you
0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Tue, Dec 3 2013


In response to: @Momeks

Hi,

Once you have set the right shininess, you can change the light color, no the attenuation. To change the attenuation you should also move the light far away from your object.
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.