2: 2014-06-21 (土) 21:40:39 iseki |
現: 2014-10-02 (木) 09:04:17 iseki |
| ** OpenSim ジオラマ 開発用 [#w8cfb9a8] | | ** OpenSim ジオラマ 開発用 [#w8cfb9a8] |
| + | AddDynamicTextureURL() |
| + | RenderPlugins[contentType].AsyncConvertUrl(updater.UpdaterID, url, extraParams); |
| + | contentType を持つモジュールの AsyncConvertUrl() を呼び出す. |
| + | |
| + | #br |
| + | *** RenderTerrainScale [#o1907c41] |
| + | - void LLDrawPoolTerrain::renderFullShader() の sDetailScale |
| + | - デフォルトは 7, テクスチャは (リージョンサイズ/7) 個繰り返し表示される.1/7 = 0.14285714 |
| + | - UVMap は (リージョンサイズ/7) 倍される. |
| + | - 256にすれば,1枚の画像. |
| + | #br |
| | | |
| *** Terrain Texture [#ta44cfc7] | | *** Terrain Texture [#ta44cfc7] |
| ↓ ↓ | | ↓ ↓ |
| → lldrawpoolterrain.cpp | | → lldrawpoolterrain.cpp |
| + | |
| | | |
| #br | | #br |
| *** Tecture Functions [#zd2d2e9c] | | *** Tecture Functions [#zd2d2e9c] |
| - lldrawpoolterrain.cpp | | - lldrawpoolterrain.cpp |
- | setVec(sDetailScale, 0.0f, 0.0f, 0.0); | + | void LLDrawPoolTerrain::renderFullShaderX() |
| + | { |
| + | // Hack! Get the region that this draw pool is rendering from! |
| + | LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion(); |
| + | LLVLComposition *compp = regionp->getComposition(); |
| + | // |
| + | LLViewerTexture *detail_texture0p = compp->mDetailTextures[4]; |
| + | |
| + | // |
| + | sDetailScale = 0.142857/36.; |
| + | |
| + | LLVector4 tp0, tp1; |
| + | |
| + | 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); |
- | | + | |
- | // | + | |
- | // detail texture 1 | + | |
- | // | + | |
- | // S32 detail1 = sShader->enableTexture(LLViewerShaderMgr::TERRAIN_DETAIL1); | + | |
- | // gGL.getTexUnit(detail1)->bind(detail_texture1p); | + | |
- | | + | |
- | /// ALPHA TEXTURE COORDS 0: | + | |
- | // gGL.getTexUnit(1)->activate(); | + | |
- | // gGL.matrixMode(LLRender::MM_TEXTURE); | + | |
- | // gGL.loadIdentity(); | + | |
- | // gGL.matrixMode(LLRender::MM_MODELVIEW); | + | |
- | | + | |
- | // detail texture 2 | + | |
- | // | + | |
- | // S32 detail2 = sShader->enableTexture(LLViewerShaderMgr::TERRAIN_DETAIL2); | + | |
- | // gGL.getTexUnit(detail2)->bind(detail_texture2p); | + | |
- | | + | |
- | // gGL.getTexUnit(2)->activate(); | + | |
- | | + | |
- | /// ALPHA TEXTURE COORDS 1: | + | |
- | // gGL.matrixMode(LLRender::MM_TEXTURE); | + | |
- | // gGL.loadIdentity(); | + | |
- | // gGL.translatef(-2.f, 0.f, 0.f); | + | |
- | // gGL.matrixMode(LLRender::MM_MODELVIEW); | + | |
- | | + | |
- | // | + | |
- | // detail texture 3 | + | |
- | // | + | |
- | // S32 detail3 = sShader->enableTexture(LLViewerShaderMgr::TERRAIN_DETAIL3); | + | |
- | // gGL.getTexUnit(detail3)->bind(detail_texture3p); | + | |
- | | + | |
- | /// ALPHA TEXTURE COORDS 2: | + | |
- | // gGL.getTexUnit(3)->activate(); | + | |
- | // gGL.matrixMode(LLRender::MM_TEXTURE); | + | |
- | // gGL.loadIdentity(); | + | |
- | // gGL.translatef(-1.f, 0.f, 0.f); | + | |
- | // gGL.matrixMode(LLRender::MM_MODELVIEW); | + | |
- | | + | |
- | // | + | |
- | // Alpha Ramp | + | |
- | // | + | |
- | //S32 alpha_ramp = sShader->enableTexture(LLViewerShaderMgr::TERRAIN_ALPHARAMP); | + | |
- | //gGL.getTexUnit(alpha_ramp)->bind(m2DAlphaRampImagep); | + | |
| // GL_BLEND disabled by default | | // GL_BLEND disabled by default |
| drawLoop(); | | drawLoop(); |
| + | |
| // Disable multitexture | | // Disable multitexture |
- | // sShader->disableTexture(LLViewerShaderMgr::TERRAIN_ALPHARAMP); | |
| sShader->disableTexture(LLViewerShaderMgr::TERRAIN_DETAIL0); | | sShader->disableTexture(LLViewerShaderMgr::TERRAIN_DETAIL0); |
- | // sShader->disableTexture(LLViewerShaderMgr::TERRAIN_DETAIL1); | + | |
- | // sShader->disableTexture(LLViewerShaderMgr::TERRAIN_DETAIL2); | + | |
- | // sShader->disableTexture(LLViewerShaderMgr::TERRAIN_DETAIL3); | + | |
- | | + | |
- | / gGL.getTexUnit(alpha_ramp)->unbind(LLTexUnit::TT_TEXTURE); | + | |
- | // gGL.getTexUnit(4)->disable(); | + | |
- | // gGL.getTexUnit(4)->activate(); | + | |
- | | + | |
- | // gGL.getTexUnit(detail3)->unbind(LLTexUnit::TT_TEXTURE); | + | |
- | // gGL.getTexUnit(3)->disable(); | + | |
- | // gGL.getTexUnit(3)->activate(); | + | |
- | | + | |
- | // gGL.matrixMode(LLRender::MM_TEXTURE); | + | |
- | // gGL.loadIdentity(); | + | |
- | // gGL.matrixMode(LLRender::MM_MODELVIEW); | + | |
- | | + | |
- | // gGL.getTexUnit(detail2)->unbind(LLTexUnit::TT_TEXTURE); | + | |
- | // gGL.getTexUnit(2)->disable(); | + | |
- | // gGL.getTexUnit(2)->activate(); | + | |
- | | + | |
- | // gGL.matrixMode(LLRender::MM_TEXTURE); | + | |
- | // gGL.loadIdentity(); | + | |
- | // gGL.matrixMode(LLRender::MM_MODELVIEW); | + | |
- | | + | |
- | // gGL.getTexUnit(detail1)->unbind(LLTexUnit::TT_TEXTURE); | + | |
- | // gGL.getTexUnit(1)->disable(); | + | |
- | // gGL.getTexUnit(1)->activate(); | + | |
- | | + | |
- | // gGL.matrixMode(LLRender::MM_TEXTURE); | + | |
- | // gGL.loadIdentity(); | + | |
- | // gGL.matrixMode(LLRender::MM_MODELVIEW); | + | |
| //---------------------------------------------------------------------------- | | //---------------------------------------------------------------------------- |
| // 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"); |