OseBeta1.11
1.11版本简化了脚本创建。好比我准备好了specular.hlsl
我只需执行
add sm lighting
vs lighting_vs20 specular.hlsl specularVS
ps lighting_ps20 specular.hlsl phongPS
你可以用shift + enter 来输入换行
运行结果:
我就可以得到如下两个program 脚本和1个material脚本:
material lighting
{
technique
{
pass
{
vertex_program_ref lighting_vs20
{
}
fragment_program_ref lighting_ps20
{
}
}
}
}
vertex_program lighting_vs20 hlsl
{
entry_point specularVS
target vs_2_0
source specular.hlsl
default_params
{
param_named_auto gCameraPosObj camera_position_object_space
param_named_auto gLightPosObj light_position_object_space 0
param_named_auto gWorldViewProj worldviewproj_matrix
}
}
fragment_program lighting_ps20 hlsl
{
entry_point phongPS
target ps_2_0
source specular.hlsl
default_params
{
param_named gSpecShine float1 20 0 0 0
param_named_auto gAmbient ambient_light_colour
param_named_auto gDiffuse light_diffuse_colour 0
param_named_auto gSpecular light_specular_colour 0
}
}
所有的constant都会自动被设置进去,只要你有统一的命名习惯,当然你也可以设置自己的命名习惯。
具体细节参见version/1.11.txt
OSE简介:
OSE根据脚本结构建立了文档目录,通过编辑目录的形式来编辑脚本。
当前支持的脚本:
.material
.program
.particle
.compositor
当前支持的编辑命令:
----------------------------------------------------------------
Edit Option | Command
----------------------------------------------------------------
change current dir | cd
add child dir | add
remove child dir | rm
copy child dir | cp
switch child dir | sd
set property | set
reset property to default | reset
----------------------------------------------------------------
当前支持的scene操作:
-------------------------------------------------------------------------------------------------
Scene Manage Option | Command
--------------------------------------------------------------------------------------------------
load mesh | lm
unload mesh | um
play animation | pa
stop animation | sa
--------------------------------------------------------------------------------------------------
attatch particle to bone or scene node |
attatch material to entity or subentity | attatch
attatch compositor to view port |
--------------------------------------------------------------------------------------------------
detach item(particle, material, compositor) | detach
--------------------------------------------------------------------------------------------------
scene light manage | set ambient in \system
| light is also a dir, it resides in \system
--------------------------------------------------------------------------------------------------
export scene | es
load scene | ls(only load exported from ose)
--------------------------------------------------------------------------------------------------
目前已知的不足之处:
当前只支持DX9。
不支持脚本继承
不支持shared_param
不支持带空格的名字
当使用shader profile 3 时,不要在相应material被使用时做以下事件:
添加,删除program ref
unloadGpg
不然程序会崩溃。
![]() | ![]() | |
![]() | ![]() | |
我在ogre论坛上也发了个帖子.
源代码放在bitbucket上
Windows下可执行文件下载地址: peanutandchestnut