This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FBConfigFile lFile( "@MyConfig.txt", true ); | |
FBString strDefault( "false" ); | |
const char *szDefault = strDefault; | |
lFile.GetOrSet( "MyCategory", "MyParameter", szDefault, "This is default comment on parameter, value (true / false)" ); | |
return ( strstr(szDefault, "true") != nullptr ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nvFX::IShader *shdPtr = fx_EffectMaterial->findShader( "SomeShader2" ); | |
if (shdPtr) | |
{ | |
// lets override current shader in the first pass of specified technique | |
fx_pass = fx_TechMaterial->getPass(0); | |
fx_pass->invalidate(); | |
// Nnnn 1 - directly override shaders |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create the input node. | |
mNodeMesh = AnimationNodeInCreate( 0, "Mesh", ANIMATIONNODE_TYPE_VECTOR ); | |
// ... | |
/************************************************ | |
* Real-time engine evaluation | |
************************************************/ | |
bool Box_RayIntersect::AnimationNodeNotify( HFBAnimationNode pAnimationNode, HFBEvaluateInfo pEvaluateInfo ) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int program = 0; | |
nvFX::IProgram *glslProgram = nullptr; | |
nvFX::IProgramPipeline *glslProgramPipeline = fx_pass->getExInterface()->getProgramPipeline(0); | |
// program pipeline means that we are using separate shader objects | |
if(glslProgramPipeline) | |
{ | |
glslProgram = glslProgramPipeline->getShaderProgram(1); // Fragment glsl program in program pipeline ! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To make the spot light works in correct way with normal maps assigned on meshes, you should change lines to these one | |
// And last but not least, figure out the spot factor ... | |
float spotFactor = 1.0f; | |
if( LightPositions[index].w ) | |
{ | |
float3 spotLightDir = normalize(LightDirections[index].xyz); | |
//spotLightDir = mul(fTangentMat, spotLightDir); | |
spotFactor = saturate( (dot( -normalize(lightDiff), -spotLightDir ) - LightDirections[index].w) / (1 - LightDirections[index].w) ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Even if the function returns to us integers (in the FBModelVertexData class) | |
/** Return Index Array*/ | |
int* GetIndexArray(); | |
// you should remember that VBO buffer type of an element is unsigned int | |
// draw all model sub patches | |
for (int i=0; i<lVertexData->GetSubPatchCount(); ++i) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FBRenderOptions *pOptions | |
FBCamera *pCamera = pOptions->GetRenderingCamera(); | |
if ( FBIS(pCamera, FBCameraSwitcher) ) | |
pCamera = ((FBCameraSwitcher*) pCamera)->CurrentCamera; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const FBVideoFormat clipFormat = (pVideoClip) ? (pVideoClip->Format) : kFBVideoFormat_RGB_24; | |
GLint internalFormat = (compressed) ? GL_COMPRESSED_RGB : GL_RGB; | |
GLint format = GL_RGB; | |
switch (clipFormat) | |
{ | |
case kFBVideoFormat_Any: | |
printf( "%s - unsupported video format\n", pVideoClip->Name ); | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Regarding to the image data and FBTexture class in OR SDK (MotionBuilder) | |
// In theory you are able to put image frame index direcly to that GetImage method | |
// that should return GLubyte *data of a specified frame | |
// but in practive it will produce error for future MoBu drawing | |
// the way out is to... | |
// 1 - first of all, specify the current frame with "CurrentFrame" property | |
// 2 - execute GetImage() function with a argument -1 by default |
OlderNewer