Author Topic: A little bit sofisticated 3D rendering...  (Read 4792 times)

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3372
  • Integrated Brain
    • View Profile
Hi there... I wrapped part of OPENGLES 1.0 and now we have a very nice commands... for you can show more realistics you objects...

Basically you can do this whit this "mini-Port"...

1 Add ligth, control the cone, and the attenuation...
2 Add specular Ligth , ambient, and difuse in different channels...
3 Control the ambient, difusse and specular properties  in the Materials...
4 Transparency...
5 comming song I will add emissive color, more beauty colors for mats...

Only a important point it´s, all command named whit gl_XXXX, you have to use values whit 1.0 or -2.0, not use 255, or values too much graters, this it´s OpenGL, and I don´t make any conversion for use values like in RGB of GLbasic...




[attachment deleted by admin]

Offline kanonet

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1142
    • View Profile
    • My GLBasic code archiv
Re: A little bit sofisticated 3D rendering...
« Reply #1 on: 2012-May-21 »
You wrap OpenGLES? Didnt Gernot already port it to a new version of gl.gbas? or is there a difference to what you are doing?
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3372
  • Integrated Brain
    • View Profile
Re: A little bit sofisticated 3D rendering...
« Reply #2 on: 2012-May-22 »
HI Kanonet... I add a few commands more... GLBasic don´t have specular brightness and changes of color over surfaces... I only add about 8 commands, but now you have a little more of powerfull...

You can touch each part of material and light , ambient, diffuse and Specular, and the spot specular, not it´s too much things... but I wil add more comming soon, but whit this few commands you can control very interesting a apareance in the objects...

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4336
    • View Profile
    • FUED
Re: A little bit sofisticated 3D rendering...
« Reply #3 on: 2012-May-22 »
This seems certanly great!
To us that work with 3d, it is something of a miss.

I haven´t yet touched 3d on glbasic to an extend.
but surely this looks great and really needed!

Offline Slydog

  • Prof. Inline
  • *****
  • Posts: 932
  • KodeSource
    • View Profile
    • KodeSource
Re: A little bit sofisticated 3D rendering...
« Reply #4 on: 2012-May-22 »
My maze is in 3D, but it looks so drab and boring.
I suck at all the lighting and advanced stuff like that.
I would love my display to 'pop' with nice shading and lighting.

I'll have to try a few of these, but since I really don't understand what they do or what they are used for, it will be me just randomly trying things out until I see a pattern, or accidently find something that works for me.

Thanks for these commands mentalthink, much appreciated!   :good:
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3372
  • Integrated Brain
    • View Profile
Re: A little bit sofisticated 3D rendering...
« Reply #5 on: 2012-May-22 »
HI Slydog... I leave you this 2 links... you can follow like tutorials... only see into de functions in C++ the name of the command like in the tutorials...

Basically you can add, a Specular color... and change color of surface... don´t care about you texture you can tint... similar to PolySprite, but en 3D...

You can focus the cone of the light... this Glbasic do it... but whit shininess you can make the light concentrate un some part of the Geometry...

Take a look to this 2 tutorials, you can understand very well...

http://www.zeuscmd.com/tutorials/opengles/index.php

http://www.falloutsoftware.com/tutorials/gl/gl8.htm#introduction

PS: The mini port, I can do it... looking this 2 tutorials... precticaly it´s the same... (Notice in Zeus web, I only look about ligths... nothing about cameras ans texturing... I hope make somethng whit textures in near time)

Offline Slydog

  • Prof. Inline
  • *****
  • Posts: 932
  • KodeSource
    • View Profile
    • KodeSource
Re: A little bit sofisticated 3D rendering...
« Reply #6 on: 2012-May-22 »
Awesome, thanks for the links!
That will keep me busy for awhile!
Especially the 2nd one about lighting.
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3372
  • Integrated Brain
    • View Profile
Re: A little bit sofisticated 3D rendering...
« Reply #7 on: 2012-May-22 »
Hi Slydog thanks!!!...

About the ligths... it´s easy, you have to think like in 3 layers... ambient, diffuse and specular...

Ambient, it´s the light commes from Universe XD
Diffuse it´s the color of the surface
Specular it´s the brightness...

In materials it´s the same... combining the 2 groups of commands, you can have more lighted materials...

A trick, put the values upper 1.0, and you have move strongs colors...

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1640
  • Particle Hawk
    • View Profile
Re: A little bit sofisticated 3D rendering...
« Reply #8 on: 2012-Jun-14 »
Nice work MT!  :good:
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3372
  • Integrated Brain
    • View Profile
Re: A little bit sofisticated 3D rendering...
« Reply #9 on: 2012-Jun-14 »
Thanks Hemlos... I hope make the library more complete... OpenGL 1.0 can do very interesting things...  :-* 1.0 and 2.0