It is currently Mon Sep 23, 2019 7:05 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Material problem for shiny alu ...
PostPosted: Sun Jul 14, 2019 11:29 am 
Offline
Enthusiast
Enthusiast

Joined: Thu May 06, 2010 10:16 am
Posts: 556
Location: Belgium
Hi,

I need (again) some help,
On the movie, the alu parts are just gray.

Image

I like to have them as shiny alu parts, now they look like gray paint.
So, what did I do ...
I used BLENDER and exported the scene and material.
Now I have three files
- blender2ogre-export.scene
- Geometry1.mesh.xml
- Material1.material

I used the second one to create my model,
but how can I use the Material1.material inside the PB program ?

LOOKS LIKE THIS :
Code:
// Material1 genrated by blender2ogre 0.6.0

material Material1
{
    receive_shadows on

    technique
    {
        pass Material1
        {
            ambient 0.6588240265846252 0.6588240265846252 0.6588240265846252 1.0
            diffuse 0.5270592291214946 0.5270592291214946 0.5270592291214946 1.0
            specular 0.5 0.5 0.5 1.0 2.5
            emissive 0.0 0.0 0.0 1.0

            alpha_to_coverage off
            colour_write on
            cull_hardware clockwise
            depth_check on
            depth_func less_equal
            depth_write on
            illumination_stage
            light_clip_planes off
            light_scissor off
            lighting on
            normalise_normals off
            polygon_mode solid
            scene_blend one zero
            scene_blend_op add
            shading gouraud
            transparent_sorting on

        }
    }
}



Thank you
Marc

_________________
- every professional was once an amateur - greetings from Pajottenland - Belgium -
http://www.marc-systems.be
PS: sorry for my english I speak flemish ...


Top
 Profile  
Reply with quote  
 Post subject: Re: Material problem for shiny alu ...
PostPosted: Sun Jul 14, 2019 3:42 pm 
Offline
Addict
Addict

Joined: Sun Jun 25, 2006 7:28 pm
Posts: 1368
Hi Marc_256
there is an example "GetScriptMaterial.pb" in the PB 3D examples
we must use:
Code:
Parse3DScripts()
GetScriptMaterial(0, "Material1")

before that we must add a path to the place in which our *.material files exist such as
Code:
Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Scripts", #PB_3DArchive_FileSystem)
Add3DArchive(".", #PB_3DArchive_FileSystem)

the last line above search inside the source code folder
then the engine will search for material Material1 with this code GetScriptMaterial(0, "Material1") .it can be also material MyMaterial and then we search for it with GetScriptMaterial(0, "MyMaterial")
to load a specific texture from the material file we use something like this:
Code:
material Material1
{
   technique
   {
      pass
      {
         ambient 0.1 0.1 0.1 1.0
         diffuse 0.1 0.1 0.1 1.0
         specular 1.0 1.0 1.0 1.0 12.5
         emissive 1.0 1.0 1.0 1.0
         texture_unit
         {
                 texture aluminum.png
            
         }
      }
   }
}


note the line texture aluminum.png
it needs expertise in designing materuals the above is just a chaotic example which are not reflective or shiny just want to show you how to use the material file
but look example CubeMapping.pb it is reflective and shiny and its material here:
C:\PureBasic\Examples\3D\Data\Scripts\CubeMap.material

there is a places in Ogre3d site have several material examples can't find it now


Top
 Profile  
Reply with quote  
 Post subject: Re: Material problem for shiny alu ...
PostPosted: Mon Jul 15, 2019 8:38 am 
Offline
Always Here
Always Here

Joined: Fri Oct 23, 2009 2:33 am
Posts: 5833
Location: Wales, UK
This might help: http://wiki.ogre3d.org/Materials

https://ogrecave.github.io/ogre/api/1.11/_material-_scripts.html

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
Reply with quote  
 Post subject: Re: Material problem for shiny alu ...
PostPosted: Mon Jul 15, 2019 11:04 am 
Offline
Enthusiast
Enthusiast

Joined: Thu May 06, 2010 10:16 am
Posts: 556
Location: Belgium
thanks applePi, IdeasVacuum,

I gone a make some time to study this stuff ...
looks good info, but still very complex to understand.

will update soon ...

marc

_________________
- every professional was once an amateur - greetings from Pajottenland - Belgium -
http://www.marc-systems.be
PS: sorry for my english I speak flemish ...


Top
 Profile  
Reply with quote  
 Post subject: Re: Material problem for shiny alu ...
PostPosted: Mon Jul 15, 2019 1:20 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu May 06, 2010 10:16 am
Posts: 556
Location: Belgium
Not perfect but a beginning in material stuff ...

Image


marc

_________________
- every professional was once an amateur - greetings from Pajottenland - Belgium -
http://www.marc-systems.be
PS: sorry for my english I speak flemish ...


Top
 Profile  
Reply with quote  
 Post subject: Re: Material problem for shiny alu ...
PostPosted: Tue Jul 16, 2019 4:45 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu May 06, 2010 10:16 am
Posts: 556
Location: Belgium
The best shiny alu material till now ...

Image

marc

_________________
- every professional was once an amateur - greetings from Pajottenland - Belgium -
http://www.marc-systems.be
PS: sorry for my english I speak flemish ...


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye