Scene.ck 文件

该文件用于定义一个游戏场景

ParticleSystem = filename
SceneFile = filename
ModelFiles = obj1.mc,obj2.mc
SkyMesh = meshName
CubeMapSize = 0
Lensflare = filename
Shader {
    Environment {
        texName_ {
            # 非 cubemap 类型的环境纹理不写 type,如 skydome 或 hdri,texName 为文件名
            Type = Cubemap
            # 6张纹理的文件名前缀
            FilePrefix = prefix
            # 或者是包含 6 张纹理内容的单个 dds 或 pvr 文件名
            File = filename
            Layer = 6
        }
    }
    Shader2D {
		Blocks = shader/blocks.ck
		Default = shader/default.ck
    }
    ShaderDepth {
		Blocks = shader/blocks.ck
		Default = shader/defaultDepth.ck
    }
    Shader3D {
		Blocks = shader/blocks.ck
		Default = shader/default.ck
		DiSpMiAt {
			Vertex = shader/main.vs
			Fragment = shader/main.fs
			Defined = '
			#define SPECULAR
			#define REFLECTIONHDR
			#define CARPAINT
			'
		}
		_ground {
			Vertex = shader/main.vs
			Fragment = shader/main.fs
			Defined = '
			#define SPECULAR
			#define GROUNDREFLECTION
			'
			Uniform {
				TexReflect = 5
			}
		}
    }
}
Materials {
    # 材质名称与 blender 中一致,这里的定义会取代 mc 文件中的同名定义
    materialName_ {
        # 提交到 shader 的 uColor 参数
		Color = 2F53B300
		# 4个参数,漫反射、高光硬度,高光强度、镜面反射,值范围都是 0 ~ 1
		Parameter = 0.0,0.1,1.0,0.2
		# 纹理文件名,不写则会使用 mc 文件中定义的纹理
		Texture = texName
		# 纹理的相关设定
		TextureWrap = Repeat|MirroredRepeat|ClampToEdge
		Mipmap = Off|On
		# 可以额外定义若干 uniform 数据
		Custom {
		    uniformName_ = vec4
		}
    }
}
GroundReflection {
    TexWidth = 512
	TexHeight = 256
}
Animation {
    File = actionfile
    objName_ {
        # 使用指定的 mesh 创建新的物体,如果没有 mesh 属性,则从场景中查找物体
        Mesh = meshName
        Mode = Loop|Sequence|Single|SingleRepeat
        Animations = act1,act2...
        AutoPlay = Yes
    }
}
DeferredRender {
    DeferredShader = shader3d
    # 其它属性同 EffectRender
}
EffectRender {
	BlurTextureSize = 128
	BlurIterations = 2
    [BlackMask = texName]
    BloomIntensity = 1.0
    # 开启 ssao,定义以下属性
    SSAOSize = 512,256
    # 开启自动亮度,定义以下属性
    StandardLuminance = 0.5
}
ShadowRender {
    TextureSize = 512
    Splits = 3
    SplitWeight = 0.8
}
# 角色动作
Actions {
    File = actFile
    actName_ {
        # 动作混合淡入时长
        BlendIn = 0
        # 循环动作在循环时的开始时间
        CyclicStart = 0
        # 用于标识各种属性,比如是否可以互动等,由项目逻辑处理
        Flag = 0
        Sound = soundFile
        # 循环模式,如果有后续动作,该属性无效
        Extrapolation = Cyclic|Constant
        [NextAction = actName]
    }
}
Actors {
    # 为指定名称的角色(骨骼物体)设置动画
    objName_ {
        Action = actionName
    }
}
Flares {
	MaxFlaresRender = 10
	Resources {
		flare = flare.atlas
	}
	Instances{
		ptFlare {
			Frame = flare/c_1
			Type = 0
		}
	}
}
MetalCore
2018-3-31
  • {{comment.name}}{{comment.time | fDateTime}}

    • {{reply.name}}{{reply.time | fDateTime}}

Recent Articles

Recent Comments