
Hope it works for ya too.
Code: Select all
...
...
void createPointLight(String _pLightName,
bool _pLightShadows,
Vector3 _pLightPosition,
const ColourValue _pLightDiffuseColor,
const ColourValue _pLightSpecularColor,
const Real _pLightAttRange,
const Real _pLightAttConstant,
const Real _pLightAttLinear,
const Real _pLightAttQuadratic)
{
Light *_Light = mSceneMgr->createLight(_pLightName + ".pointlight");
_Light->setType(Light::LT_POINT);
_Light->setCastShadows(_pLightShadows);
_Light->setDiffuseColour(_pLightDiffuseColor / 255);
_Light->setSpecularColour(_pLightSpecularColor / 255);
_Light->setAttenuation(
(_pLightAttRange),
(_pLightAttConstant / 255),
(_pLightAttLinear / 100000),
(_pLightAttQuadratic / 100000));
SceneNode* _node = mSceneMgr->
getRootSceneNode()->createChildSceneNode(_pLightName + ".lightnode");
_node->attachObject(_Light);
_node->setPosition(_pLightPosition);
}
...
...
void createPointLightFlourescent(void) {
createPointLight(
"PointLightFlourescent", // Name
true, // Shadows false/true
Vector3(0,64,0), // Position
(ColourValue(230,230,255)), // Diffuse Color
(ColourValue(0,0,0)), // Specular Color
512, // Attenuation Range
128, // Attenuation Constant
16, // Attenuation Linear
16 // Attenuation Quadratic
);
}
...
...
Code: Select all
createPointLightFlourescent();
You can't go from fixed function to per pixel lighting and expect the same frame rate. Ever. And you can't just drop in a shader into any scene and expect it to be the best way to do things.who woulda thought right
Code: Select all
15:53:22: Parsing script monster.program
15:53:22: An exception has been thrown!
-----------------------------------
Details:
-----------------------------------
Error #: 8
Function: ResourceGroupManager::openResource
Description: Cannot locate resource monster_vs.source in resource group General..
File: C:\ogre3d\OgreMain\src\OgreResourceGroupManager.cpp
Line: 501
Stack unwinding: <<beginning of stack>>
The shaders are within a single file but they are referenced in the program definition as separated filesSome new Ofusion shaders would be fantastic so thanks for the effort and I hope the problem can be fixed. I did follow the instructions as directed in the readme.
Code: Select all
/////////////////////////////////////////////////////////////////////////////////////////////////
// VERT COMES
/////////////////////////////////////////////////////////////////////////////////////////////////
void monster_vs // ******Change to this method name********
(
float4 position : POSITION,
float3 normal : NORMAL,
out float4 oPosition : POSITION
...
Code: Select all
/////////////////////////////////////////////////////////////////////////////////////////////////
// FRAG COMES
/////////////////////////////////////////////////////////////////////////////////////////////////
void monster_ps( // ******Change to this method name********
#if DIFFUSE_TEXTURE
uniform sampler2D diffuseMap : register(s1),
...
Code: Select all
vertex_program monster_vs cg
{
source monster.source // ******Change to value name********
default_params
{
param_named_auto lightPosition0 light_position_object_space 0
param_named_auto lightPosition1 light_position_object_space 1
param_named_auto lightPosition2 light_position_object_space 2
param_named_auto eyePosition camera_position_object_space
param_named_auto worldviewproj worldviewproj_matrix
param_named scale float 2
}
entry_point monster_vs // ******Change to value name********
profiles vs_1_1 arbvp1
}
Code: Select all
fragment_program monster_ps cg
{
source monster.source // ******Change to value name********
default_params
{
param_named_auto lightDiffuse0 light_diffuse_colour 0
param_named_auto lightDiffuse1 light_diffuse_colour 1
param_named_auto lightDiffuse2 light_diffuse_colour 2
param_named_auto lightSpecular0 light_specular_colour 0
param_named_auto lightSpecular1 light_specular_colour 1
param_named_auto lightSpecular2 light_specular_colour 2
param_named_auto atten0 light_attenuation 0
param_named_auto atten1 light_attenuation 1
param_named_auto atten2 light_attenuation 2
param_named exponent0 float 127
param_named scaleBias float4 0.04 -0.02 1 0
param_named ambient float4 0.0 0.0 0.1 1.0
}
entry_point monster_ps // ******Change to value name********
profiles ps_2_0 arbfp1
}
... because it emphasises the effectjacmoe wrote:This is nice!
Just one thing, though: Why does offset mapping always look like slimy alien skin? Looks cool, but bricks normally doesn't look like that.
Code: Select all
Error #: 9
Function: CgProgram::loadFromSource
Description: Unable to compile Cg program Simple_Perpixel_Vert: CG ERROR : The compile returned an error.
(78) : warning C7011: implicit cast from "float4" to "float3"
(88) : error C0000: syntax error, unexpected ',', expecting '(' at token ","
(88) : error C0501: type name expected at token ","
(91) : error C1068: too much data in type constructor
(91) : error C1033: cast not allowed
(91) : error C0000: syntax error, unexpected ';', expecting ')' at token ";"
(91) : error C0501: type name expected at token ";"
Code: Select all
Error #: 9
Function: CgProgram::loadFromSource
Description: Unable to compile Cg program Simple_PerPixel_Frag: CG ERROR : The compile returned an error.
(78) : warning C7011: implicit cast from "float4" to "float3"
(88) : error C0000: syntax error, unexpected ',', expecting '(' at token ","
(88) : error C0501: type name expected at token ","
(91) : error C1068: too much data in type constructor
(91) : error C1033: cast not allowed
(91) : error C0000: syntax error, unexpected ';', expecting ')' at token ";"
(91) : error C0501: type name expected at token ";"
Code: Select all
Error #: 9
Function: CgProgram::loadFromSource
Description: Unable to compile Cg program Ambient: CG ERROR : The compile returned an error.
(78) : warning C7011: implicit cast from "float4" to "float3"
(88) : error C0000: syntax error, unexpected ',', expecting '(' at token ","
(88) : error C0501: type name expected at token ","
(91) : error C1068: too much data in type constructor
(91) : error C1033: cast not allowed
(91) : error C0000: syntax error, unexpected ';', expecting ')' at token ";"
(91) : error C0501: type name expected at token ";"