GLBasic forum

Codesnippets => 3D-snippets => Topic started by: mentalthink on 2012-May-20

Title: A little bit sofisticated 3D rendering...
Post by: mentalthink on 2012-May-20
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]
Title: Re: A little bit sofisticated 3D rendering...
Post by: kanonet 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?
Title: Re: A little bit sofisticated 3D rendering...
Post by: mentalthink 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...
Title: Re: A little bit sofisticated 3D rendering...
Post by: erico 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!
Title: Re: A little bit sofisticated 3D rendering...
Post by: Slydog 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:
Title: Re: A little bit sofisticated 3D rendering...
Post by: mentalthink 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)
Title: Re: A little bit sofisticated 3D rendering...
Post by: Slydog on 2012-May-22
Awesome, thanks for the links!
That will keep me busy for awhile!
Especially the 2nd one about lighting.
Title: Re: A little bit sofisticated 3D rendering...
Post by: mentalthink 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...
Title: Re: A little bit sofisticated 3D rendering...
Post by: Hemlos on 2012-Jun-14
Nice work MT!  :good:
Title: Re: A little bit sofisticated 3D rendering...
Post by: mentalthink 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