GLBasic forum

Main forum => GLBasic - en => Topic started by: MrTAToad on 2011-Nov-01

Title: Pixelated lighting
Post by: MrTAToad on 2011-Nov-01
As you can see from the picture, the lighting creates a rather pixelated effect, which is not desirable.

I tried increasing the number of triangles but that didn't help - would increasing the texture size help ?

[attachment deleted by admin]
Title: Re: Pixelated lighting
Post by: erico on 2011-Nov-02
Mr Tatoad, I don´t believe the texture size is the problem.

It may have something to do with your light position, try getting it further away from the object.
It seems to me I get this kind of behavior when light is too close to the object, or inside it.
Title: Re: Pixelated lighting
Post by: Hatonastick on 2011-Nov-02
Shadow issues aside, that looks cool. :)
Title: Re: Pixelated lighting
Post by: MrTAToad on 2011-Nov-02
Thanks!

I'll try moving it away then...
Title: Re: Pixelated lighting
Post by: Kitty Hello on 2011-Nov-02
flat shaded surfaces? (Flat normal vectors?)
Title: Re: Pixelated lighting
Post by: MrTAToad on 2011-Nov-02
Flat shaded surfaces (I presume) - at least thats the option selected in AC3D's texture coordinator :)

I do notice the shadow demo also has the same problem too (although as the objects there are somewhat smaller, it's not so noticeable).
Title: Re: Pixelated lighting
Post by: erico on 2011-Nov-02
yep thinking better about it kitty must be right, it is similar to those images I poster here:
http://www.glbasic.com/forum/index.php?topic=6861.msg55521#msg55521

where shadows on the flat surface is just what you have there.
Title: Re: Pixelated lighting
Post by: MrTAToad on 2011-Nov-02
Yes, that sounds similar, in which case Gernot will need to update the 3D system :)
Title: Re: Pixelated lighting
Post by: erico on 2011-Nov-02
Now I don´t get it,
I think you are suppose to use smooth shaded surfaces/normals for proper results.
I also understand that if you load an external object, it comes with smooth surfaces automatic.
Title: Re: Pixelated lighting
Post by: MrTAToad on 2011-Nov-02
From reading that, I took it that there was no automatic smoothing...
Title: Re: Pixelated lighting
Post by: Kitty Hello on 2011-Nov-03
auto-normals is a feature for user-generated obejcts. Imports are just he way you design then. In AC3D, that's Opbejct properties/crease angle
Title: Re: Pixelated lighting
Post by: erico on 2011-Nov-04
 :offtopic:does it mean it I convert an object from OBJ or blender to DDD, lets say a ball, and have it half smooth, half sharp it will get through?
Title: Re: Pixelated lighting
Post by: MrTAToad on 2011-Nov-04
I've tried different crease angles, but none seemed to make a difference :



[attachment deleted by admin]
Title: Re: Pixelated lighting
Post by: erico on 2011-Nov-04
Did you try out messing light position and angle of vision(my guess you did)?
What type of light are you using? Normal or shadow stuff?
Title: Re: Pixelated lighting
Post by: Kitty Hello on 2011-Nov-04
can you post the sphere object?
Title: Re: Pixelated lighting
Post by: AMateus on 2011-Nov-04
I believe this has to do with the fact the light in glbasic is per-vertex and not per-point.

So, if per-vertex, the more detailed is the object the better.

I believe.. lol
Title: Re: Pixelated lighting
Post by: Kitty Hello on 2011-Nov-04
No. What you export is what you display.
Title: Re: Pixelated lighting
Post by: MrTAToad on 2011-Nov-04
The Ac3D and DDD files are included

[attachment deleted by admin]
Title: Re: Pixelated lighting
Post by: mentalthink on 2011-Nov-04
HI Mrtatoad, the sphere it´s made whit som 3d software, or it´s coded into Glbasic.

In the first case, I think the trouble it´s whit the texture mapping...

Make a test, disable the texture, if the sphere looks fine it´s the texture, I lock the last images, and if you take a look whit care, you can see, portions of triangles, like in groups, like puzzle piezes... I think this it´s the error.

Sometimes in 3ds max I have this trouble, and all the troubles it´s for the texture mapping, the most cases it´s when make a unwrap texture...

Another thing, can be the cone of the light, if it´s too much little and the cone of the light don´t affect all the surface can be this, in the 3D suites, appears this effect, if the ligth not it´s in a good place.

And well this it´s a lazy, but the ligth don´t have the -3 ID....  :giveup: :giveup:

Title: Re: Pixelated lighting
Post by: erico on 2011-Nov-04
Mentalthink has a point, it can be the UVMAP.
I will take a look at it too later.

by the way, did I tell you this game of yours is coming out really nice?
Title: Re: Pixelated lighting
Post by: MrTAToad on 2011-Nov-04
No you didn't until you wrote it :)

I'll see what it looks like without the texture...

Unfortunately its not the texture - this is what it looks like without the texture :



[attachment deleted by admin]
Title: Re: Pixelated lighting
Post by: erico on 2011-Nov-04
It is really strange as the shades are hitting quads instead of triangles....hmmmmm
Title: Re: Pixelated lighting
Post by: MrTAToad on 2011-Nov-05
Yes, I dont know why - I changed the distance of lighting, but that hasn't helped.

The circle should be composed of triangles (and not quads) as that is the option selected for spheres...  I wonder if the exporter uses quads...
Title: Re: Pixelated lighting
Post by: erico on 2011-Nov-05
I can´t open DDD or AC.

At the worst case scenario, I can create a ball here and add your map into it, or prepare it to accept your maps as they are.
As far as I tried on the snowman thread, it all did work.

If such case is delaying your game, let me know.

But we must find out the reasons for that!
Title: Re: Pixelated lighting
Post by: Hatonastick on 2011-Nov-05
Hmm interesting.  I just changed the torus to a sphere in GLB's 3D Shadow test and it's doing exactly what Mr TA Toad's example/program is doing.

Edit: Actually the shape doesn't matter.  Just noticed the Torus has pixelated lighting/shadows as well.  As if it's lighting up quads.  Looks very ugly and not at all how the shadow demo used to look.  BTW this is on my PC and not Android or something like that. :)

Looks to me that there's no blending going on.  Each 'quad' is either on or off.  At least that's how it looks on the shadow demo when I run it, might not be the same on yours.
Title: Re: Pixelated lighting
Post by: MrTAToad on 2011-Nov-05
Oh yes, the Shadow demo does the same...

No, its not holding anything up!
Title: Re: Pixelated lighting
Post by: Hatonastick on 2011-Nov-05
My point being that it's not a problem with your model.  I kinda forgot to add that part. :)

I realise you know that, but I find I have to state the obvious because that's how I'm wired.  =D
Title: Re: Pixelated lighting
Post by: bigsofty on 2011-Nov-05
Looks like you've lost your smoothing groups, try exporting as an .OBJ and then convert to .DDD
Title: Re: Pixelated lighting
Post by: Hatonastick on 2011-Nov-05
I don't see how it can be a problem with his object if the 3D Shadows demo, that is part of the GLB release and which creates its own objects on the fly, has _exactly_ the same issue -- especially when it never used to have that problem.

Edit:  Sorry, when I read that back I sound like I'm being harsh.  It wasn't meant that way. :)
Title: Re: Pixelated lighting
Post by: Kitty Hello on 2011-Nov-05
I see there's something seriously wrong. Also a donut won't show properly.
(http://www.glbasic.com/pix/tnbumpy_light.png) (http://www.glbasic.com/pix/bumpy_light.png)

Title: Re: Pixelated lighting
Post by: mentalthink on 2011-Nov-05
For me the sphere of Mrtatoad whitout texture appears, Smooth...

Perhaps it´s somthing about the graphics cards?¿, NVIDIA or ATI ?¿.
Title: Re: Pixelated lighting
Post by: MrTAToad on 2011-Nov-05
I'm using a nVidia 9800 GTX with quality settings (tried performance settings too)...
Title: Re: Pixelated lighting
Post by: Hatonastick on 2011-Nov-05
Hmmm... I'm NVidia too...
Title: Re: Pixelated lighting
Post by: MrTAToad on 2011-Nov-05
It does sound as though Gernot has found a lighting problem though...
Title: Re: Pixelated lighting
Post by: mentalthink on 2011-Nov-05
I have Nvidia 460 GTS, this it´s very strange ?¿.
Title: Re: Pixelated lighting
Post by: MrTAToad on 2011-Nov-05
That is odd - can you post a screenie ?
Title: Re: Pixelated lighting
Post by: Ian Price on 2011-Nov-05
I have an ATI gfx card. if you want to post a simple example .EXE I (and other users) can try it to see if this is a gfx card problem or something else.
Title: Re: Pixelated lighting
Post by: MrTAToad on 2011-Nov-05
It'll save me time if I package my project :)

And here it is : http://www.zshare.net/download/956747365e733167/
Title: Re: Pixelated lighting
Post by: Ruidesco on 2011-Nov-05
It first complains of an "OVER.ddd" not being found when set up. Closing and executing the project again makes it work though.
ATI Mobility Radeon HD 4650 here and the problem shows.
In any case Gernot did say something is wrong with GLBasic's 3D at this stage.
Title: Re: Pixelated lighting
Post by: fuzzy70 on 2011-Nov-05
Out of interest I tried the shadow sample in linux, had the same problem so that should rule out a gfx card/driver issue

Fedora Core - Nvidia 240GT
Ubuntu - ATI x1550 ( I think, mainly use it as a server lol)
Title: Re: Pixelated lighting
Post by: MrTAToad on 2011-Nov-05
QuoteIt first complains of an "OVER.ddd" not being found when set up. Closing and executing the project again makes it work though.
Weird!
Title: Re: Pixelated lighting
Post by: fuzzy70 on 2011-Nov-05
Quote from: Ruidesco on 2011-Nov-05
It first complains of an "OVER.ddd" not being found when set up. Closing and executing the project again makes it work though.
ATI Mobility Radeon HD 4650 here and the problem shows.
In any case Gernot did say something is wrong with GLBasic's 3D at this stage.

I had that error as well


Lee
Title: Re: Pixelated lighting
Post by: mentalthink on 2011-Nov-05
Hi Mrtatoad, I found the error..

I try you program, but don´t works the exe in my PC... :whip: :whip: =D

Well I make somthing whit your 3d object and my 3d object, another simple Sphere from 3d max... and the result it´s faceted balls...

Well I think you have the camera whit a very lower values from the targte of the camera...

I try whit this

X_camera 0,0,-10 ,0,0,0

Whit this values, the ligth it´s faceted.

X_camera 0,0,-100, 0,0,0

Runs perfectlly....

PS: The code it´s a refurbished, of another 3D fx like 8 bits, can be not too much clear, sorry.




[attachment deleted by admin]
Title: Re: Pixelated lighting
Post by: MrTAToad on 2011-Nov-05
Yes, the further away the camera is, the better it looks (although at a distance you can see the pixelation) - but I need the camera to be close.  In addition, your example doesn't actually light the object  - the z distance is a bit too far for it...  The object should be lit in a pink colour...

Move it closer (so that the light shines on it, and you'll get the pixelation effect).
Title: Re: Pixelated lighting
Post by: MrTAToad on 2011-Nov-05
Quote from: fuzzy70 on 2011-Nov-05
Quote from: Ruidesco on 2011-Nov-05
It first complains of an "OVER.ddd" not being found when set up. Closing and executing the project again makes it work though.
ATI Mobility Radeon HD 4650 here and the problem shows.
In any case Gernot did say something is wrong with GLBasic's 3D at this stage.

I had that error as well


Lee
No idea why, especially if it works the second time  :whistle:

Its most likely a caching problem when directly run from the archive - its not something I get...
Title: Re: Pixelated lighting
Post by: mentalthink on 2011-Nov-06
can use this ?¿
   X_MAKE3D 1,1000,8
      X_CAMERA 0,0,-500,0,0,0

change the FOV, don´t have distortion...


[attachment deleted by admin]
Title: Re: Pixelated lighting
Post by: Hatonastick on 2011-Nov-06
I'm still not convinced that there is necessarily anything wrong with Mr TA Toads own project, especially not when a demo that comes with GLB that I've been using for testing purposes myself on and off the past month has gone from being smooth to being pixelated without me changing anything (in the project source, but I may have updated graphics drivers during that time).  So I still think either it's a GLB issue, or a driver related issue -- not an issue with Mr TA Toad's project. :)

If there is in fact anyone out there who can compile the Shadows example that comes with GLB (inside the 3D directory) and _not_ have the pixelated lighting issue I would have to ask a) what graphics card and drivers are you using, and b) are you using the very latest version of GLB.
Title: Re: Pixelated lighting
Post by: MrTAToad on 2011-Nov-06
Quote from: mentalthink on 2011-Nov-06
can use this ?¿
   X_MAKE3D 1,1000,8
      X_CAMERA 0,0,-500,0,0,0

change the FOV, don´t have distortion...
Indeed - but there is no problem with ambient lighting.  Dont forget this is caused by spot/parallel lighting (which Gernot has stated there is a problem).