Page 1 of 1

Material problem for shiny alu ...

Posted: Sun Jul 14, 2019 11:29 am
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

Re: Material problem for shiny alu ...

Posted: Sun Jul 14, 2019 3:42 pm
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

Re: Material problem for shiny alu ...

Posted: Mon Jul 15, 2019 8:38 am
by IdeasVacuum

Re: Material problem for shiny alu ...

Posted: Mon Jul 15, 2019 11:04 am
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

Re: Material problem for shiny alu ...

Posted: Mon Jul 15, 2019 1:20 pm
by marc_256
Not perfect but a beginning in material stuff ...

Image


marc

Re: Material problem for shiny alu ...

Posted: Tue Jul 16, 2019 4:45 pm
by marc_256
The best shiny alu material till now ...

Image

marc