Hello, i am creating nodes from tangent meshes with parallax mapping as showed in the tutorial, but with each node created, all the nodes get darker. What could be the problem?
Thank you
PARALLAX_MAP getting darker with each instance [solved]
PARALLAX_MAP getting darker with each instance [solved]
Last edited by Holiday on Thu Aug 20, 2009 10:12 pm, edited 1 time in total.
-
- Posts: 914
- Joined: Fri Aug 03, 2007 12:43 pm
- Location: South Africa
- Contact:
screens:
code:
code:
Code: Select all
smgr->getMeshManipulator()->makePlanarTextureMapping(newMesh->getMesh(0), 0.003f);
scene::IMesh* tangentMesh = smgr->getMeshManipulator()->createMeshWithTangents(newMesh->getMesh(0));
node = smgr->addMeshSceneNode(tangentMesh);
video::ITexture* normalMap = driver->getTexture("test.jpg");
driver->makeNormalMapTexture(normalMap, 11.0f);
node->setMaterialTexture(1, normalMap);
node->setMaterialFlag(video::EMF_FOG_ENABLE, true);
node->setMaterialType(video::EMT_PARALLAX_MAP_SOLID);
// adjust height for parallax effect
node->getMaterial(0).MaterialTypeParam = 1.3f;
tangentMesh->drop();
-
- Posts: 914
- Joined: Fri Aug 03, 2007 12:43 pm
- Location: South Africa
- Contact:
As DeM0nFiRe said-
Do you call this multiple times?
In this case you're making a normal map from a height map (copying height from brightness into the channel alpha, putting normals into colour channels), then doing the same again on the normal map. After calling it the first time the texture is no longer a height map, so subsequent calls will cause problems.
Code: Select all
driver->makeNormalMapTexture(normalMap, 11.0f);
In this case you're making a normal map from a height map (copying height from brightness into the channel alpha, putting normals into colour channels), then doing the same again on the normal map. After calling it the first time the texture is no longer a height map, so subsequent calls will cause problems.