SoftPixel Forum

Official community of the SoftPixel Engine and the SoftPixel Sandbox (REGISTRATION only with consultation with the Admin)
It is currently Mon Apr 23, 2018 3:41 pm

All times are UTC

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Wed Sep 25, 2013 9:19 pm 
Site Admin
User avatar

Joined: Sat Jul 07, 2012 5:58 pm
Posts: 540
Location: Germany
The SoftPixel Engine 3.3 comes with a whole new script language. Very simple and comfortable for creating
material states, shaders, vertex formats, textures and texture layers.
This will replace the old and deprecated script-framework or rather script-loader.

In this thread I will explain the syntax and semantic with the following example script.

Here is the specification as text file: SoftPixel MaterialScript Spec.txt
And here is the XML file for the syntax highlighting for Notepad++: SoftPixel MaterialScript Highlighting.xml

Here is a small example script:
; TestScript.material file

material "MyMaterial" {
    colorMaterial = false
    diffuse = 240, 200, 50
    ambient = 50, 20, 5
    polygonOffset = true
    offsetFactor = -1.0

@texPath = @workingDir + "/Textures/"

texture "MyTex0" { imageFile = @texPath + "TestImage.jpg" }

texture "MyTex1" {
    renderTarget = true
    width = 512
    height = 512
    filter {
        mipMaps = false
        wrap = clamp

And this is the associated C++ code:
tool::MaterialScriptReader Reader;

video::MaterialStatePtr Material = Reader.findMaterial("MyMaterial");
video::Texture* Tex0 = Reader.findTexture("Tex0");
video::Texture* Tex1 = Reader.findTexture("Tex1");

My latest project:
- The XièXiè Programming Language

My hardware:
- GIGABYTE GeForce GTX 670
- Intel Core i7 (Ivy-Bridge)
- 16 GB DDR3

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 1 guest

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® Forum Software © phpBB Group