Author Topic: Problems with shading and lights  (Read 13146 times)

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4306
    • View Profile
    • Portfolio
Re: Problems with shading and lights
« Reply #45 on: 2015-Nov-19 »
I don´t understand what is your problem with the skybox.
Like in my code, isen´t just a matter of appending it to camera movement?
Where is the clipping?

Offline ProN3rd

  • Mc. Print
  • *
  • Posts: 38
    • View Profile
Re: Problems with shading and lights
« Reply #46 on: 2015-Nov-27 »
sure it is, i think there is a misunderstanding, i mean not clipping, but edgeclamping.

If i was to use skybox-graphics for the cube, i would have either have to draw 8 objects (all of them being surfaces with different textures), or draw 1 cube-objects that uses a huge textures where each face has differnt texture coordinates.

for the first approach, all edges of the cube dont go smoothly into each other. The 2nd approach has only some edges run smoothly into each other.

The texture is simply not "clamped" to the edge of the surface. As far as i read in the internet this seems to be a commond problem that occurs especially on skyboxes. OpenGL therefore provides to command "Clamp_to_edge". However i do not know how to include it in GLBasic.

This is exactly what i mean: http://gamedev.stackexchange.com/questions/11931/skybox-texture-artifact-on-edge It describes the problem along with the solution and a screenshot.

« Last Edit: 2015-Nov-27 by ProN3rd »

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4306
    • View Profile
    • Portfolio
Re: Problems with shading and lights
« Reply #47 on: 2015-Nov-27 »
I see, but that dosen´t happen on my testings, I´m using the second approach, a huge uvmapped imported cube.
I´m drawing it before lights, so it is always fully lit.

Do you think this could help you out?

Offline nabz32

  • Community Developer
  • Dr. Type
  • ******
  • Posts: 311
    • View Profile
Re: Problems with shading and lights
« Reply #48 on: 2015-Nov-29 »
I haven´t got a problem with clamping, since I switched to a sky cylinder,

if you want the code, just answer here.

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4306
    • View Profile
    • Portfolio
Re: Problems with shading and lights
« Reply #49 on: 2015-Nov-30 »
No need it´s fine, if you wish, you can put it on snippets, so future chaps can check it out.
Glad everything is fine. :good:

Offline ProN3rd

  • Mc. Print
  • *
  • Posts: 38
    • View Profile
Re: Problems with shading and lights
« Reply #50 on: 2015-Dec-02 »
that would be awesome nabz

lol i crashed my graphics card with too much shading -_-
so that topic is out of the question at least for now

but i found some very nice open gl examples in the snippets section, INLINE here i come :)

by the way, i tried many things to make a texture of irregular size (like 237*183)  fit on a billbord rectangle surface but I seems like only texture sizes with a multiple of n^2 work correctly. Can anyone confirm this?
« Last Edit: 2015-Dec-02 by ProN3rd »