Author Topic: Metallic materials  (Read 2789 times)

0 Members and 1 Guest are viewing this topic.

Charles Pegge

  • Guest
Metallic materials
« on: May 23, 2013, 04:13:47 AM »
Different materials can be created by changing the ambient, diffuse, specular colors along with shininess.

Examples from materials.inc

  RedShinyMaterial.ambient   <= .10,.10,.00,1.
  RedShinyMaterial.diffuse   <= .55,.00,.00,1.
  RedShinyMaterial.specular  <= .40,.90,.90,1.
  RedShinyMaterial.shininess <= 1024.

  GoldMaterial.ambient       <= .10,.10,.00,1.
  GoldMaterial.diffuse       <= .00,.00,.00,1.
  GoldMaterial.specular      <= .99,.80,.00,1.
  GoldMaterial.shininess     <= 5.


The example below is metallic.o2bas


X

Charles Pegge

  • Guest
Re: Metallic materials
« Reply #1 on: May 24, 2013, 11:50:27 AM »
This Craft is made entirely from spheres

from craft.inc

  'CRAFT MAIN BODY
  glPushMatrix
  glTranslatef -.5,-1.,-8.0
  glRotatef    ang1,0,1,0
  glRotatef    10.,1,0,0
  glScalef      3.,.5,1.
  AlloyMaterial.act
  glCallList sphere
  '
  'FIN
  glpushMatrix
  glTranslatef -.5,.2,.0
  glScalef      .4,.89,.15
  glCallList sphere
  glPopMatrix
 
  'WINGS
  glpushMatrix
  glTranslatef .2,.2,.0
  glScalef      .25,.3,3
  glCallList sphere
  glPopMatrix
 
  'TAIL
  glpushMatrix
  glTranslatef -.75,.2,.0
  glScalef      .125,.15,1.5
  glCallList sphere
  glPopMatrix
 
  'CABIN
  glTranslatef .4,.5,.0
  glScalef      .5,.5,.5
  BlackShinyMaterial.act
  glCallList sphere
  glPopMatrix
  '



X

Peter

  • Guest
Re: Metallic materials
« Reply #2 on: May 24, 2013, 12:21:39 PM »
Looks like a shark, he should have some cold water.
Or is it an air shark? if so, he hunts birds?

Frankolinox

  • Guest
Re: material question:) Metallic materials
« Reply #3 on: May 25, 2013, 02:01:18 AM »
that's looking very interesting :-) thanks for the example!

question:

in one of my 3d graphic software I have material stuff with a preview dialog too, that's looking like this:

Code: [Select]
'gold material in one of my 3d software programs looks like this one:

' gold (metal color)
color: 1.0, 0.7, 0.3
specular sharpness 10.0
specular brightness 4.0

'copper (metal color)
color: 0.7, 0.4, 0.3
specular sharpness 10.0
specular brightness 1.0
reflection fading 1.0

'steel
color: 0.4, 0.4, 0.41
reflection fading 1.0
specular sharpness 10.0
specular brightness 3.0
roughness densitiy 1.0
roughness 1.0

a) the gold material parameters are different from oxygen, do you know why ?

b) do you have any idea how to make reflections for material or something in work?

best regards, frank

Charles Pegge

  • Guest
Re: Metallic materials
« Reply #4 on: May 25, 2013, 11:28:16 AM »
Hi Frank,

The steel, copper and gold are my own formulations. Metrics like roughness and reflection fade have no direct Opengl equivalent. They are produced at a higher level.

I am very interested in producing reflections. The simplest would be to render the real part of the scene, then do the same scene in mirror image with opposite light position and darker settings.

Mirror imaging is very easy: You can do it with negative scales:

glScalef -1.0,0.0,0.0 will produce a left-right switch

Another technique is capture the scene into a texture and then map it onto the reflective surface.

Charles