shader实现凹凸效果
2012-09-14 19:17
429 查看
转自:http://blog.csdn.net/pizi0475/article/details/5389449
材质用的是这个文件中的
ogrenew/Samples/Media/materials/scripts/OffsetMapping.material
多个technique,硬件不支持牛B的效果还有最后的technique来垫底
material Examples/OffsetMapping/Specular
{
// This is the preferred technique which uses both vertex and
// fragment programs, supports coloured lights
technique
{
// do the lighting and bump mapping with parallax pass
pass
{
// Vertex program reference
vertex_program_ref Examples/OffsetMappingVP
{
param_named_auto lightPosition light_position_object_space 0
param_named_auto eyePosition camera_position_object_space
param_named_auto worldViewProj worldviewproj_matrix
}
// Fragment program
fragment_program_ref Examples/OffsetMappingFP
{
param_named_auto lightDiffuse light_diffuse_colour 0
param_named_auto lightSpecular light_specular_colour 0
// Parallax Height scale and bias
param_named scaleBias float4 0.04 -0.02 1 0
}
// Normal + height(alpha) map
texture_unit
{
texture rockwall_NH.tga
tex_coord_set 0
}
// Base diffuse texture map
texture_unit
{
texture rockwall.tga
tex_coord_set 1
}
}
}
// This is the preferred technique which uses both vertex and
// fragment programs, supports coloured lights
technique
{
// do the lighting and bump mapping with parallax pass
pass
{
// Vertex program reference
vertex_program_ref Examples/OffsetMappingVP
{
param_named_auto lightPosition light_position_object_space 0
param_named_auto eyePosition camera_position_object_space
param_named_auto worldViewProj worldviewproj_matrix
}
// Fragment program
fragment_program_ref Examples/OffsetMappingPS
{
param_indexed_auto 0 light_diffuse_colour 0
param_indexed_auto 1 light_specular_colour 0
// Parallax Height scale and bias
param_indexed 2 float4 0.04 -0.02 1 0
}
// Normal + height(alpha) map
texture_unit
{
texture rockwall_NH.tga
tex_coord_set 0
}
// Base diffuse texture map
texture_unit
{
texture rockwall.tga
tex_coord_set 1
}
}
}
// Simple no-shader fallback
technique
{
pass
{
// Base diffuse texture map
texture_unit
{
texture rockwall.tga
}
}
}
}
材质用的是这个文件中的
ogrenew/Samples/Media/materials/scripts/OffsetMapping.material
多个technique,硬件不支持牛B的效果还有最后的technique来垫底
material Examples/OffsetMapping/Specular
{
// This is the preferred technique which uses both vertex and
// fragment programs, supports coloured lights
technique
{
// do the lighting and bump mapping with parallax pass
pass
{
// Vertex program reference
vertex_program_ref Examples/OffsetMappingVP
{
param_named_auto lightPosition light_position_object_space 0
param_named_auto eyePosition camera_position_object_space
param_named_auto worldViewProj worldviewproj_matrix
}
// Fragment program
fragment_program_ref Examples/OffsetMappingFP
{
param_named_auto lightDiffuse light_diffuse_colour 0
param_named_auto lightSpecular light_specular_colour 0
// Parallax Height scale and bias
param_named scaleBias float4 0.04 -0.02 1 0
}
// Normal + height(alpha) map
texture_unit
{
texture rockwall_NH.tga
tex_coord_set 0
}
// Base diffuse texture map
texture_unit
{
texture rockwall.tga
tex_coord_set 1
}
}
}
// This is the preferred technique which uses both vertex and
// fragment programs, supports coloured lights
technique
{
// do the lighting and bump mapping with parallax pass
pass
{
// Vertex program reference
vertex_program_ref Examples/OffsetMappingVP
{
param_named_auto lightPosition light_position_object_space 0
param_named_auto eyePosition camera_position_object_space
param_named_auto worldViewProj worldviewproj_matrix
}
// Fragment program
fragment_program_ref Examples/OffsetMappingPS
{
param_indexed_auto 0 light_diffuse_colour 0
param_indexed_auto 1 light_specular_colour 0
// Parallax Height scale and bias
param_indexed 2 float4 0.04 -0.02 1 0
}
// Normal + height(alpha) map
texture_unit
{
texture rockwall_NH.tga
tex_coord_set 0
}
// Base diffuse texture map
texture_unit
{
texture rockwall.tga
tex_coord_set 1
}
}
}
// Simple no-shader fallback
technique
{
pass
{
// Base diffuse texture map
texture_unit
{
texture rockwall.tga
}
}
}
}
相关文章推荐
- shader实例(二十)法线贴图实现凹凸效果
- Unity3D 实现雪花飘飞效果[Shader]
- unity用shader实现物体的忽隐忽现效果
- 实现组件的凹凸效果
- 实现组件的凹凸效果
- WebGL+shader实现素描效果渲染
- 第五天,终于实现了水下模糊效果(动态挂载脚本),blur里写入shader
- Unity光晕剑效果的Shader简单实现
- [Shader 着色器]冰霜效果的思考和实现
- Shader特效——实现“HDR”效果【GLSL】
- Shader特效——“Sephia等效果”的实现 【GLSL】
- Unity中使用Shader实现3D打印机效果
- Shaders to regulate image lightness like in PhotoShop(shader实现Photoshop的亮度调节效果,按钮变暗效果)
- 【Shader】Shader实现头像遮罩效果
- Unity用Shader实现波浪效果
- Shader实现法线映射、透明效果
- Shader实现头像遮罩效果
- unity3D 涂涂乐使用shader实现上色效果
- 材质动态加载贴图实现灰色效果 shader
- 小随笔:利用Shader实现模型爆炸和沙粒化的效果