iPhone lighting

Previous topic - Next topic

Crivens

Ok brilliant, I will try it tonight. Which bits have changed BTW as I modified one or two things to make things easier in my version.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Kitty Hello


Crivens

Good point considering I've used code merging comparison tools everyday for years at work :-[ Funny how you run on autopilot sometimes, especially the day after a bank holiday.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

bigsofty

Well these are the modifications I used to get iVCL running at a descent  speed, also I seem to remember having the same problems with dim lighting, which I 'think' I sorted out. Be warned though, anything that requires 2 render passes has been removed. Oh, and not all the changes have been documented, sorry.
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

Crivens

Ok I will see how it goes. I'm getting more the opposite of "dim" though. It is too bright. Although you can sort of see it that way in that everything his harder to see because of the sort of haze put on things.

2 render passes? Such as? I'm not doing anything amazing BTW. It's mainly cubes and spheres. Utterly brilliant (sort of) in it's simplicity if you ask me. I'm not even texturing the spheres (just modified the createsphere routines to allow a passed in colour) to keep it simple.

Also if you sorted it out before then are you saying that the dimness might be something to do with the entity system (strange as works on PC and WebOS fine) rather than GLB? Would it be an idea, considering how simple my game is, to remove the entity system and use standard GLB? Hmm. Make that a no. I can always use textures to give a nice effect if necessary, although I am quite liking the extra effects (eg. shadows and a sort of police strobe effect I bunged in) through lighting.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

bigsofty

Stencil shadows for example are two passes, also anything 2D IIRC has been removed, multiple lights etc...

Well the iVCL apps lighting is fine and it uses the entity system but I had a lot of trouble with the lighting at the beginning. Again, on the PC it was fine, on the iPhone it was dim(and too bright). This is, unfortunately, the only piece of iVCL code that I can publish as the entity system is opensource.
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

Crivens

Fair enough. Hopefully it does the job. If not then not sure what to do. Might be worth mucking around with the colour of the light but doesn't look great so far. Alternatively I may try the spot light suggestion. How do you that with the entity system?

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Kitty Hello

entity already uses a spot light.
Try uncommenting the INLINE part, that's dealing with light attentuation.

Crivens

Which function is that? Entity_intern_lights? Not sure where I see the comment. Or is it only in the newly posted code (haven't looked at yet)? Out of interest I just noticed that Entity_intern_lights has a @ sign before the function command. What does that mean?

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Kitty Hello

@ means it can be hidden from the jump-tree on the right side.

Crivens

Ah ok. That's a good idea for internal functions and the like. So which function did you mean to uncomment?

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Kitty Hello

the inline stuff. There's 3 OPENGL calls.

Crivens

Hmm, not getting very far with this. I've tried the iOS specific entity system (or least took out this bits that are different and put it into my own modified version) and no joy. Setting the spotlight to 180 does make it darker, but it's darker not dimmer if you know what I mean. If you want the grass to stay really green, for instance, then it doesn't it's really dark green and you still have that kind of bright dimness thing going on that's hard to explain...

I changed the INLINE code to be commented and not. Because it wasn't commented to begin with I assume you meant comment it like this:-
Code (glbasic) Select
IF o.cnst > 0 OR o.linear > 0 OR o.quadratic > 0
INLINE
#ifdef HAVE_OPENGL
    #define GL_LIGHT0 0x4000
    #define GL_CONSTANT_ATTENUATION 0x1207
    #define GL_LINEAR_ATTENUATION             0x1208
    #define GL_QUADRATIC_ATTENUATION          0x1209
    //glLightf(GL_LIGHT0+iLight, GL_CONSTANT_ATTENUATION,  o.cnst);
    //glLightf(GL_LIGHT0+iLight, GL_LINEAR_ATTENUATION, o.linear);
    //glLightf(GL_LIGHT0+iLight, GL_QUADRATIC_ATTENUATION, o.quadratic);
    #else
    // #error no light attentiation
    #endif
ENDINLINE
ENDIF
Doesn't seem to make any difference.

Very confusing. I'm one step away from just leaving lights out on iOS and just using textures to look like smooth spheres, or possibly try different textures for the grass to see if it looks any better with the brightness effect iOS seems to be doing.

Out of interest does anyone have any example code that shows 3D lighting (doesn't have to be the 3Dentity system I guess) that also works fine on iOS without mucking around with the brightness?

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Ian Price

The thing is, YOU know the difference between the pc and iOS versions. Would anyone else really notice the difference if they didn't know about it? Is this really that important to the overall enjoyment of the app? Can you not fake it with just a simple screengrab from the pc version?

Sometimes it's impossible to get the desired result exactly as you want it - sometimes it really isn't worth spending valuable time trying to implement a feature that is insignificant? Is this that sometimes?
I came. I saw. I played.

Crivens

Possibly. It's just annoying as the lighting is working it just has this stupid brightness to everything. If I change the colours just for iOS then it is better but still not right and everything looks sort of cloudy. Dont get me wrong I can do without the lighting it just looks better with it. Annoying...

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.