Material problem for shiny alu ...

Everything related to 3D programming
marc_256
Enthusiast
Enthusiast
Posts: 743
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Material problem for shiny alu ...

Post by marc_256 »

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: Select all

// 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 -
PS: sorry for my english I speak flemish ...
applePi
Addict
Addict
Posts: 1404
Joined: Sun Jun 25, 2006 7:28 pm

Re: Material problem for shiny alu ...

Post by applePi »

Hi Marc_256
there is an example "GetScriptMaterial.pb" in the PB 3D examples
we must use:

Code: Select all

Parse3DScripts()
GetScriptMaterial(0, "Material1")
before that we must add a path to the place in which our *.material files exist such as

Code: Select all

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: Select all

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
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Material problem for shiny alu ...

Post by IdeasVacuum »

IdeasVacuum
If it sounds simple, you have not grasped the complexity.
marc_256
Enthusiast
Enthusiast
Posts: 743
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Re: Material problem for shiny alu ...

Post by marc_256 »

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 -
PS: sorry for my english I speak flemish ...
marc_256
Enthusiast
Enthusiast
Posts: 743
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Re: Material problem for shiny alu ...

Post by marc_256 »

Not perfect but a beginning in material stuff ...

Image


marc
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
marc_256
Enthusiast
Enthusiast
Posts: 743
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Re: Material problem for shiny alu ...

Post by marc_256 »

The best shiny alu material till now ...

Image

marc
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
Post Reply