5: 2014-10-01 (Wed) 17:39:47 iseki  |
Cur: 2014-10-02 (Thu) 09:04:17 iseki  |
| *** RenderTerrainScale [#o1907c41] | | *** RenderTerrainScale [#o1907c41] |
| - void LLDrawPoolTerrain::renderFullShader() の sDetailScale | | - void LLDrawPoolTerrain::renderFullShader() の sDetailScale |
- | - デフォルトは 7, テクスチャは 256/7 個繰り返し表示される.1/7 = 0.14285714 | + | - デフォルトは 7, テクスチャは (リージョンサイズ/7) 個繰り返し表示される.1/7 = 0.14285714 |
- | - 座標を 7で割った余りが,テクスチャの座標. | + | - UVMap は (リージョンサイズ/7) 倍される. |
| - 256にすれば,1枚の画像. | | - 256にすれば,1枚の画像. |
| #br | | #br |
| ↓ ↓ | | ↓ ↓ |
| → lldrawpoolterrain.cpp | | → lldrawpoolterrain.cpp |
| + | |
| | | |
| #br | | #br |
| // | | // |
| LLViewerTexture *detail_texture0p = compp->mDetailTextures[4]; | | LLViewerTexture *detail_texture0p = compp->mDetailTextures[4]; |
| + | |
| // | | // |
| sDetailScale = 0.142857/36.; | | sDetailScale = 0.142857/36.; |
| + | |
| LLVector4 tp0, tp1; | | LLVector4 tp0, tp1; |
| + | |
| tp0.setVec(sDetailScale, 0.0f, 0.0f, 0.0); | | tp0.setVec(sDetailScale, 0.0f, 0.0f, 0.0); |
| tp1.setVec(0.0f, sDetailScale, 0.0f, 0.0); | | tp1.setVec(0.0f, sDetailScale, 0.0f, 0.0); |
| + | |
| // | | // |
| // detail texture 0 | | // detail texture 0 |
| gGL.getTexUnit(detail0)->bind(detail_texture0p); | | gGL.getTexUnit(detail0)->bind(detail_texture0p); |
| gGL.getTexUnit(0)->activate(); | | gGL.getTexUnit(0)->activate(); |
| + | |
| LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; | | LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; |
| llassert(shader); | | llassert(shader); |
| + | |
| shader->uniform4fv(LLShaderMgr::OBJECT_PLANE_S, 1, tp0.mV); | | shader->uniform4fv(LLShaderMgr::OBJECT_PLANE_S, 1, tp0.mV); |
| shader->uniform4fv(LLShaderMgr::OBJECT_PLANE_T, 1, tp1.mV); | | shader->uniform4fv(LLShaderMgr::OBJECT_PLANE_T, 1, tp1.mV); |
| + | |
| gGL.matrixMode(LLRender::MM_TEXTURE); | | gGL.matrixMode(LLRender::MM_TEXTURE); |
| gGL.loadIdentity(); | | gGL.loadIdentity(); |
| gGL.matrixMode(LLRender::MM_MODELVIEW); | | gGL.matrixMode(LLRender::MM_MODELVIEW); |
| + | |
| // GL_BLEND disabled by default | | // GL_BLEND disabled by default |
| drawLoop(); | | drawLoop(); |
| + | |
| // Disable multitexture | | // Disable multitexture |
| sShader->disableTexture(LLViewerShaderMgr::TERRAIN_DETAIL0); | | sShader->disableTexture(LLViewerShaderMgr::TERRAIN_DETAIL0); |
| + | |
| //---------------------------------------------------------------------------- | | //---------------------------------------------------------------------------- |
| // Restore Texture Unit 0 defaults | | // Restore Texture Unit 0 defaults |
| + | |
| gGL.getTexUnit(detail0)->unbind(LLTexUnit::TT_TEXTURE); | | gGL.getTexUnit(detail0)->unbind(LLTexUnit::TT_TEXTURE); |
| gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); | | gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); |
| { | | { |
| LLUUID tmp_id; | | LLUUID tmp_id; |
| + | |
| msg->getUUID("RegionInfo", "TerrainDetail0", tmp_id); | | msg->getUUID("RegionInfo", "TerrainDetail0", tmp_id); |
| compp->setDetailTextureID(0, tmp_id); | | compp->setDetailTextureID(0, tmp_id); |
| msg->getUUID("RegionInfo", "TerrainDetail3", tmp_id); | | msg->getUUID("RegionInfo", "TerrainDetail3", tmp_id); |
| compp->setDetailTextureID(3, tmp_id); | | compp->setDetailTextureID(3, tmp_id); |
| + | |
| // Iseki | | // Iseki |
| tmp_id.set("1c5e544e-9198-4681-b87e-9868ae61e461"); | | tmp_id.set("1c5e544e-9198-4681-b87e-9868ae61e461"); |