Alpha-Transparency support for Interiors
by Christian M Weber · 10/06/2003 (8:53 am) · 45 comments
Download Code File
Working transparent polys in TGE
This works with current HEAD (9/30/2003)
--------------------
BACK UP YOUR CODE
--------------------
First, d/l the ZIP file and place interiorTrans.* files in your interior folder
Open your vc6 project, and add interiorTrans.cc to your Torque Demo files
Also add it you Torque Lib files
Now for the fun part!
Goto your engine\interior folder
Open interior.cc
Find: const Surface& rSurface = mSurfaces[output[i]];
after it add
Repeat the above step 5 more times (till you can't find any more matching strings)
Save & close file.
Open interior.h
find: class InteriorInstance;
add after it
find: friend class EditGeometry;
add after "friend class InteriorInstance;"
Find: SurfaceOutsideVisible = BIT(4),
after it add
change SurfaceFlagMask to look like this
Find: U32 fanMask;
add above it
Save & close file.
open interiorInstance.cc
after the #includes
add
Goto line 577~
add above "addToScene();"
( under those { } near by )
Find: removeFromScene();
add above it
Find: sri->mDetailLevel = detailLevel;
add above "PROFILE_END();"
Find: void InteriorInstance::setTransform(const MatrixF & mat)
add above "if (isServerObject())"
Save & close file.
Open interiorInstance.h
after the #includes
add
Find: class AudioEnvironment;
add after it
Find: Convex* mConvexList;
add after it
Save & close file.
open interiorIO.cc
Find: stream.read(&mSurfaces[i].surfaceFlags);
add after it
Find: stream.write(mSurfaces[i].surfaceFlags);
add after it
Save & close file.
Goto your tools\map2dif folder
Open editGeometry.cc
After the #includes and extern
add
find: case DetailBrush:
after "break;"
add
find: if (pToker->getToken()[0] != '}')
add above it
find: pEntity = new DetailEntity;
add after it
find: rSurface.winding.brushId = brush.brushId;
add after it
Scroll down to: rSurface.flags = (brush.mBrushType == DetailBrush) ? Interior::SurfaceDetail : 0;
add after it
Scroll down some more to: ce.flags = (brush.mBrushType == DetailBrush) ? Interior::SurfaceDetail : 0;
add after it
Save & close file.
Open editGeometry.h
find: class DoorEntity;
add after it
find: U32 flags;
add after it
Save & close file.
Open entityTypes.cc
Goto line 211
add
Save & close file.
Open entityTypes.h
Goto line 71
add
Save & close file.
Open exportGeometry.cc
find: rSurface.surfaceFlags = editSurface.flags & Interior::SurfaceFlagMask;
add after it
Save & close file.
Open main.cc
find: EditInteriorResource* gWorkingResource = NULL;
add after it
find: // Give status
replace
Save & close file.
Open morianBasics.h
find: VehicleCollisionBrush = 4
change so it looks like this
Save & close file.
Do a FULL compile of Torque Lib, the Demo and last map2dif
For WorldCraft, open your .fgd file
Scroll down some and add after the detail entity
For QuArK, Goto addons\Torque folder
Open DataTorque.qrk
Find: detail:b =
add after the detail entity
I've included a test.map test.dif and the 2 textures it uses.
Some code based off of James "Corvidae" William's interior trans http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3704
Working transparent polys in TGE
This works with current HEAD (9/30/2003)
--------------------
BACK UP YOUR CODE
--------------------
First, d/l the ZIP file and place interiorTrans.* files in your interior folder
Open your vc6 project, and add interiorTrans.cc to your Torque Demo files
Also add it you Torque Lib files
Now for the fun part!
Goto your engine\interior folder
Open interior.cc
Find: const Surface& rSurface = mSurfaces[output[i]];
after it add
if(bool(rSurface.surfaceFlags & SurfaceTrans)) continue;This will keep our trans polys out of the active poly list
Repeat the above step 5 more times (till you can't find any more matching strings)
Save & close file.
Open interior.h
find: class InteriorInstance;
add after it
class InteriorTrans;
find: friend class EditGeometry;
add after "friend class InteriorInstance;"
friend class InteriorTrans;
Find: SurfaceOutsideVisible = BIT(4),
after it add
SurfaceTrans = BIT(5),
change SurfaceFlagMask to look like this
SurfaceFlagMask = (SurfaceDetail |
SurfaceAmbiguous |
SurfaceOrphan |
SurfaceSharedLMaps |
SurfaceOutsideVisible |
SurfaceTrans) // TransparentFind: U32 fanMask;
add above it
// transparent
U8 alpha;
U32 alphaSrc;
U32 alphaDst;Save & close file.
open interiorInstance.cc
after the #includes
add
#include "interior/InteriorTrans.h"
Goto line 577~
add above "addToScene();"
( under those { } near by )
// now loop thru the interior and get all transparent polys
if (isClientObject()) {
Interior* pInterior = mInteriorRes->getDetailLevel(0);
for (i = 0; i < pInterior->mSurfaces.size(); i++) {
const Interior::Surface& rSurface = pInterior->mSurfaces[i];
if(rSurface.surfaceFlags & Interior::SurfaceTrans) {
InteriorTrans *transPolys = new InteriorTrans;
transPolys->pInteriorInstance = this;
transPolys->pInterior = pInterior;
transPolys->surfaceIndex = i;
transPolys->textureName = mMaterialMaps[0]->getMaterial(rSurface.textureIndex).getGLName();
transPolys->Update();
interiorTransPolys.link(transPolys);
}
}
}Find: removeFromScene();
add above it
interiorTransPolys.free();
Find: sri->mDetailLevel = detailLevel;
add above "PROFILE_END();"
// TODO - transpolys are not checked against zones
// ALL trans polys render when interior is in view
InteriorTrans *transPolys = NULL;
while( bool(transPolys = interiorTransPolys.next(transPolys)) ) {
SceneRenderImage* image = new SceneRenderImage;
image->obj = transPolys;
image->isTranslucent = true;
image->sortType = SceneRenderImage::Point;
image->poly[0] = transPolys->sortPoint;
// Insert it into the scene images.
state->insertRenderImage(image);
}Find: void InteriorInstance::setTransform(const MatrixF & mat)
add above "if (isServerObject())"
InteriorTrans *transPolys = NULL;
while( bool(transPolys = interiorTransPolys.next(transPolys)) ) {
transPolys->Update();
}Save & close file.
Open interiorInstance.h
after the #includes
add
#ifndef _LLIST_H_ #include "core/llist.h" #endif
Find: class AudioEnvironment;
add after it
class InteriorTrans;
Find: Convex* mConvexList;
add after it
LList <InteriorTrans> interiorTransPolys;
Save & close file.
open interiorIO.cc
Find: stream.read(&mSurfaces[i].surfaceFlags);
add after it
if(bool(mSurfaces[i].surfaceFlags & SurfaceFlags::SurfaceTrans)) {
stream.read(&mSurfaces[i].alpha);
stream.read(&mSurfaces[i].alphaSrc);
stream.read(&mSurfaces[i].alphaDst);
}Find: stream.write(mSurfaces[i].surfaceFlags);
add after it
if(bool(mSurfaces[i].surfaceFlags & SurfaceFlags::SurfaceTrans)) {
stream.write(mSurfaces[i].alpha);
stream.write(mSurfaces[i].alphaSrc);
stream.write(mSurfaces[i].alphaDst);
}Save & close file.
Goto your tools\map2dif folder
Open editGeometry.cc
After the #includes and extern
add
extern U32 gTrans;
find: case DetailBrush:
after "break;"
add
case TransparentBrush: // TransparentBrushs are detail brushes
mDetailBrushes.push_back(gBrushArena.allocateBrush());
pBrush = mDetailBrushes.last();
pBrush->mBrushType = TransparentBrush;
pBrush->materialType = 0;
pBrush->brushId = mCurrBrushId++;
gTrans++;
break;find: if (pToker->getToken()[0] != '}')
add above it
switch (pEntity->getBrushType()) {
case TransparentBrush:
if(pBrush->mPlanes[0].owningEntity == NULL)
pBrush->mPlanes[0].owningEntity = static_cast<TransEntity*>(mEntities.last());
break;
}find: pEntity = new DetailEntity;
add after it
else if (pToker->tokenICmp(TransEntity::getClassName()))
pEntity = new TransEntity;find: rSurface.winding.brushId = brush.brushId;
add after it
if(brush.mBrushType == TransparentBrush) {
TransEntity* Trans = static_cast<TransEntity*>(brush.mPlanes[0].owningEntity);
rSurface.alpha = Trans->mAlpha;
rSurface.alphaSrc = Trans->mAlphaSrc;
rSurface.alphaDst = Trans->mAlphaDst;
}Scroll down to: rSurface.flags = (brush.mBrushType == DetailBrush) ? Interior::SurfaceDetail : 0;
add after it
rSurface.flags |= (brush.mBrushType == TransparentBrush) ? (Interior::SurfaceTrans | Interior::SurfaceDetail) : 0;
Scroll down some more to: ce.flags = (brush.mBrushType == DetailBrush) ? Interior::SurfaceDetail : 0;
add after it
rSurface.flags |= (brush.mBrushType == TransparentBrush) ? Interior::SurfaceDetail : 0;Null Surface don't need trans support
Save & close file.
Open editGeometry.h
find: class DoorEntity;
add after it
class TransEntity;
find: U32 flags;
add after it
U8 alpha;
U32 alphaSrc;
U32 alphaDst;Save & close file.
Open entityTypes.cc
Goto line 211
add
TransEntity::TransEntity() {
}
TransEntity::~TransEntity() {
}
#ifndef GL_ZERO
/* BlendingFactorSrc */
#define GL_ZERO 0
#define GL_ONE 1
#define GL_DST_COLOR 0x0306
#define GL_ONE_MINUS_DST_COLOR 0x0307
#define GL_SRC_ALPHA_SATURATE 0x0308
#define GL_SRC_ALPHA 0x0302
#define GL_ONE_MINUS_SRC_ALPHA 0x0303
#define GL_DST_ALPHA 0x0304
#define GL_ONE_MINUS_DST_ALPHA 0x0305
/* BlendingFactorDest */
/* GL_ZERO */
/* GL_ONE */
#define GL_SRC_COLOR 0x0300
#define GL_ONE_MINUS_SRC_COLOR 0x0301
/* GL_SRC_ALPHA */
/* GL_ONE_MINUS_SRC_ALPHA */
/* GL_DST_ALPHA */
/* GL_ONE_MINUS_DST_ALPHA */
#endif // !GL_ZERO
U32 getAlphaValByName(Tokenizer* pToker) {
U32 blend;
if(pToker->tokenICmp("GL_ZERO")) {
blend = GL_ZERO;
}
else if(pToker->tokenICmp("GL_ONE")) {
blend = GL_ONE;
}
else if(pToker->tokenICmp("GL_DST_COLOR")) {
blend = GL_DST_COLOR;
}
else if(pToker->tokenICmp("GL_ONE_MINUS_DST_COLOR")) {
blend = GL_ONE_MINUS_DST_COLOR;
}
else if(pToker->tokenICmp("GL_SRC_ALPHA_SATURATE")) {
blend = GL_SRC_ALPHA_SATURATE;
}
else if(pToker->tokenICmp("GL_SRC_ALPHA")) {
blend = GL_SRC_ALPHA;
}
else if(pToker->tokenICmp("GL_DST_ALPHA")) {
blend = GL_DST_ALPHA;
}
else if(pToker->tokenICmp("GL_ONE_MINUS_DST_ALPHA")) {
blend = GL_ONE_MINUS_DST_ALPHA;
}
else if(pToker->tokenICmp("GL_SRC_COLOR")) {
blend = GL_SRC_COLOR;
}
else if(pToker->tokenICmp("GL_ONE_MINUS_SRC_COLOR")) {
blend = GL_ONE_MINUS_SRC_COLOR;
}
else if(pToker->tokenICmp("GL_ONE_MINUS_SRC_ALPHA")) {
blend = GL_ONE_MINUS_SRC_ALPHA;
}
else {
dPrintf("\nAlpha Blend invalid: %s\n", pToker->getToken());
blend = GL_ZERO;
}
return blend;
}
bool TransEntity::parseEntityDescription(Tokenizer* pToker) {
// Tokenizer comes in pointing to the classname. We'll check that, just to be
// thorough.
AssertFatal(pToker->tokenICmp(getClassName()),
avar("Wrong class name? (expected %s, got %s)", getClassName(), pToker->getToken()));
pToker->advanceToken(true);
while (pToker->getToken()[0] != '{' && pToker->getToken()[0] != '}') {
if (pToker->tokenICmp("alpha")) {
pToker->advanceToken(false, true);
mAlpha = dAtoi(pToker->getToken());
}
else if (pToker->tokenICmp("alphaSrc")) {
pToker->advanceToken(false, true);
AssertISV(dStrlen(pToker->getToken()) < 255, avar("Error: Name %s must be less than 255 chars!", pToker->getToken()));
mAlphaSrc = getAlphaValByName(pToker);
}
else if (pToker->tokenICmp("alphaDst")) {
pToker->advanceToken(false, true);
AssertISV(dStrlen(pToker->getToken()) < 255, avar("Error: Name %s must be less than 255 chars!", pToker->getToken()));
mAlphaDst = getAlphaValByName(pToker);
}
else
pToker->advanceToken(false);
pToker->advanceToken(true);
}
return true;
}
BrushType TransEntity::getBrushType() {
return TransparentBrush;
}
const char* TransEntity::getClassName() {
return "trans";
}
bool TransEntity::isPointClass() const {
return false;
}
const char* TransEntity::getName() const {
static char bogoChar = '[[60c1e6e2cb268]]';
return &bogoChar;
}
const Point3D& TransEntity::getOrigin() const {
static Point3D bogoPoint(0, 0, 0);
return bogoPoint;
}Save & close file.
Open entityTypes.h
Goto line 71
add
class TransEntity : public EditGeometry::Entity
{
public:
TransEntity();
~TransEntity();
U8 mAlpha;
U32 mAlphaSrc;
U32 mAlphaDst;
static const char* getClassName();
bool parseEntityDescription(Tokenizer* pToker);
const char* getName() const;
const Point3D& getOrigin() const;
BrushType getBrushType();
// ok, not really, but as far as the parser is concered, yes.
bool isPointClass() const;
};Save & close file.
Open exportGeometry.cc
find: rSurface.surfaceFlags = editSurface.flags & Interior::SurfaceFlagMask;
add after it
rSurface.alpha = editSurface.alpha; rSurface.alphaSrc = editSurface.alphaSrc; rSurface.alphaDst = editSurface.alphaDst;
Save & close file.
Open main.cc
find: EditInteriorResource* gWorkingResource = NULL;
add after it
U32 gTrans = 0; // Used for the statistics screen
find: // Give status
replace
dPrintf("\n STATISTICS\n"
" - Total brushes: %d\n"
" + structural: %d\n"
" + detail: %d\n"
" + portal: %d\n"
" - Number of zones: %d\n"
" - Number of surfaces: %d\n", gWorkingGeometry->getTotalNumBrushes(),
gWorkingGeometry->getNumStructuralBrushes(),
gWorkingGeometry->getNumDetailBrushes(),
gWorkingGeometry->getNumPortalBrushes(),
gWorkingGeometry->getNumZones(),
gWorkingGeometry->getNumSurfaces());withdPrintf("\n STATISTICS\n"
" - Total brushes: %d\n"
" + structural: %d\n"
" + detail: %d\n"
" + portal: %d\n"
" + transparent: %d\n"
" - Number of zones: %d\n"
" - Number of surfaces: %d\n", gWorkingGeometry->getTotalNumBrushes(),
gWorkingGeometry->getNumStructuralBrushes(),
gWorkingGeometry->getNumDetailBrushes() - gTrans,
gWorkingGeometry->getNumPortalBrushes(),
gTrans,
gWorkingGeometry->getNumZones(),
gWorkingGeometry->getNumSurfaces());Save & close file.
Open morianBasics.h
find: VehicleCollisionBrush = 4
change so it looks like this
VehicleCollisionBrush = 4, TransparentBrush = 5
Save & close file.
Do a FULL compile of Torque Lib, the Demo and last map2dif
For WorldCraft, open your .fgd file
Scroll down some and add after the detail entity
@SolidClass = trans : "Trans Detail Brush Entity" [ alpha(string) : "alpha" : "100" alphaSrc(string) : "alphaSrc" : "GL_SRC_ALPHA" alphaDst(string) : "alphaDst" : "GL_ONE_MINUS_SRC_ALPHA" ]
For QuArK, Goto addons\Torque folder
Open DataTorque.qrk
Find: detail:b =
add after the detail entity
trans:b =
{
;incl = "brush64"
;desc = "Transparent Brush Entity"
alpha = "100"
alphaSrc = "GL_SRC_ALPHA"
alphaDst = "GL_ONE_MINUS_SRC_ALPHA"
}I've included a test.map test.dif and the 2 textures it uses.
Some code based off of James "Corvidae" William's interior trans http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3704
About the author
#22
10/28/2003 (11:43 am)
Ok I have been testing with this code and I see a problem when firing a weapon at the translucent wall. The translucent wall will disappear for a second or two and then come back. The explosion from the projectiles impact and triggering some code that messes up the rendering maybe?
#23
Change the declaration of renderLights method in interior.h to
In interiorRender.cc add an include for interiorInstance.h after #include "interior.h". Next change the renderLights arguments to match header file
Futher down in same method change this
to this
The last thing to do is change the call to renderLights. Open up interiorInsrtance.cc and find the call to renderLights (around line 978) and change it to this
That's it. If I get time I will work out the correct code for rendering the lights on the trans surface.
10/29/2003 (3:13 pm)
I whipped up a workaround for the lighting problem. Basically, I check to see if the surface is translucent/transparent and skip dynamic light rendering if it is. The real solution is to change the rendering routine if it detects trans.Change the declaration of renderLights method in interior.h to
void renderLights(LightInfo* pInfo,
const MatrixF& transform,
InteriorInstance *pInstance,
U32* lightSurfaces,
U32 numLightSurfaces);In interiorRender.cc add an include for interiorInstance.h after #include "interior.h". Next change the renderLights arguments to match header file
void Interior::renderLights(LightInfo* pInfo,
const MatrixF& transform,
InteriorInstance *pInstance,
U32* lightSurfaces,
U32 numLightSurfaces)Futher down in same method change this
for (U32 i = 0; i < numLightSurfaces; i++) {
const Surface& rSurface = mSurfaces[lightSurfaces[i]];to this
for (U32 i = 0; i < numLightSurfaces; i++) {
if (pInstance->getDetailLevel(0)->mSurfaces[lightSurfaces[i]].surfaceFlags
& SurfaceTrans)
continue;
const Surface& rSurface = mSurfaces[lightSurfaces[i]];The last thing to do is change the call to renderLights. Open up interiorInsrtance.cc and find the call to renderLights (around line 978) and change it to this
pInterior->renderLights(lightArray[i], mRenderWorldToObj, this, lightSurfaces, numLightSurfaces);
That's it. If I get time I will work out the correct code for rendering the lights on the trans surface.
#24
Thats only if its shot with something like the crossbow.
AND, the length of time the wall stays solid seem to corrospond to the smoke particles.
11/23/2003 (3:04 pm)
Ok, that solution works, sortof, it makes the transparencie go solid for a second.Thats only if its shot with something like the crossbow.
AND, the length of time the wall stays solid seem to corrospond to the smoke particles.
#25
Also.... I was playing arround with the examples and I noticed that it seems that only the walls that are hit flicker. If this is the case can you encase any interior that you want transparent with another interior that is slightly larger, and then set the texture of the larger interior to NULL? This way you can keep the collision of the larger interior, but the appearance of the transparent interior.
I would play around with this to see if it works, but again I can not get map2dif to compile. I think that it is due to the mods that I made seting up the day/night mod.
Cameron
**EDIT**
Never mind about the NULL texture idea, it appears to flicker when the explosion is in semi-close proximity to the transparency, not necessarily only when struck by the projectile.
12/17/2003 (9:33 pm)
I have not been able to get the map2dif to compile, can someone send it to me? cbditt0 (at) yahoo.comAlso.... I was playing arround with the examples and I noticed that it seems that only the walls that are hit flicker. If this is the case can you encase any interior that you want transparent with another interior that is slightly larger, and then set the texture of the larger interior to NULL? This way you can keep the collision of the larger interior, but the appearance of the transparent interior.
I would play around with this to see if it works, but again I can not get map2dif to compile. I think that it is due to the mods that I made seting up the day/night mod.
Cameron
**EDIT**
Never mind about the NULL texture idea, it appears to flicker when the explosion is in semi-close proximity to the transparency, not necessarily only when struck by the projectile.
#26
12/21/2003 (1:57 pm)
Alright, use the code above, it works, but if the projectile/explosion has particles in it, it goes solid where the particles are drawn. Dont know how to get around that yet, but could be Alpha-trans sorting problem.
#27
09/08/2004 (8:54 pm)
Great resource! The examples work but the new wntity type doesn't show up in the list. I'm using World Craft and edited the fgd.
#28
Is the last rar the most current or have you done some more on it since last year?
09/09/2004 (12:25 am)
Hi Chris,Is the last rar the most current or have you done some more on it since last year?
#29
If you don't, you'll get flickering, like mentioned above. If you do this, however, you won't see that. Sure, the dynamic lighting won't show up at all on transparent surfaces, but no solid walls or anything.
Very happy here!
09/24/2004 (10:45 pm)
BTW, if you integrate this with John's LightingPack and use Mark Harmon's dynamic lighting fix, you'll need to modify the "SG_INTERIOR_RENDERLIGHTS_3" method to pass the interiorInstance into the LP code.If you don't, you'll get flickering, like mentioned above. If you do this, however, you won't see that. Sure, the dynamic lighting won't show up at all on transparent surfaces, but no solid walls or anything.
Very happy here!
#30
Searching for U32 Flags; doesn't work because there is now more space inbetween U32 and the word Flags;.
I'm running into this problem when compiling though. Can anyone help? I don't understand what it means really.
12/08/2004 (11:36 am)
I ran into 2 snags.Searching for U32 Flags; doesn't work because there is now more space inbetween U32 and the word Flags;.
I'm running into this problem when compiling though. Can anyone help? I don't understand what it means really.
map2dif warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification map2dif error LNK2019: unresolved external symbol "public: bool __thiscall InteriorTrans::Update(void)" (?Update@InteriorTrans@@QAE_NXZ) referenced in function "protected: virtual bool __thiscall InteriorInstance::onAdd(void)" (?onAdd@InteriorInstance@@MAE_NXZ) map2dif error LNK2019: unresolved external symbol "public: __thiscall InteriorTrans::InteriorTrans(void)" (??0InteriorTrans@@QAE@XZ) referenced in function "protected: virtual bool __thiscall InteriorInstance::onAdd(void)" (?onAdd@InteriorInstance@@MAE_NXZ)
#31
the error says this: error C2259: 'TransEntity' : cannot instantiate abstract class
and its at EditGeometry.cc
when you do:
else if (pToker->tokenICmp(TransEntity::getClassName()))
{
pEntity = new TransEntity;
}
any ideas why?
01/04/2005 (11:58 am)
I'm getting an error that I can't figure outthe error says this: error C2259: 'TransEntity' : cannot instantiate abstract class
and its at EditGeometry.cc
when you do:
else if (pToker->tokenICmp(TransEntity::getClassName()))
{
pEntity = new TransEntity;
}
any ideas why?
#32
I can't find this line... could it because I have the lighting pack?
04/12/2005 (5:57 pm)
Can someone help me please.... Quote:Scroll down some more to: ce.flags = (brush.mBrushType == DetailBrush) ? Interior::SurfaceDetail : 0;
I can't find this line... could it because I have the lighting pack?
#33
@Joseph - it should be "rSurface.flags... " etc. not "ce.flags..." and in the most recent version of it is formatted diffrerently (in case you are doing a search for the exact line).
I'm still trying to get it to work, but when I export I get the error: "Brushes cannot be associated with GameEntities!" that occurs in an imaginary folder "c:\tgenewdemo\torque\tools\map2dif\entitytypes.cc @ 2058" (imaginary because tgenewdemo doesn't seem to exist!) Anyone know what this might mean? I can't seem to find any information on it and the code all seems to be in place.
04/29/2005 (8:59 am)
@Neil - did you add InteriorTrans.h & InteriorTran.cc to both Torque lib and demo projects?@Joseph - it should be "rSurface.flags... " etc. not "ce.flags..." and in the most recent version of it is formatted diffrerently (in case you are doing a search for the exact line).
I'm still trying to get it to work, but when I export I get the error: "Brushes cannot be associated with GameEntities!" that occurs in an imaginary folder "c:\tgenewdemo\torque\tools\map2dif\entitytypes.cc @ 2058" (imaginary because tgenewdemo doesn't seem to exist!) Anyone know what this might mean? I can't seem to find any information on it and the code all seems to be in place.
#34
Our team will keep working on this and post more if we find out something new.
09/20/2005 (8:48 am)
Has anyone gotten this to work with Cartography Shop? Ours is compiling fine, and our transparencies are working better, but sometimes they still render weird, objects behind transparent textures don't render or appear dark.Our team will keep working on this and post more if we find out something new.
#35
To follow up on David Grace's comments about getting Mark Harmon's light fix working for the lighting pack: As of lighting pack version 1.3.5, I can't find any reference to SG_INTERIOR_RENDERLIGHTS_3. However, there is an sgRenderLights() function. Make the same changes to that function that Mark suggests for the renderLights() function in his comment, and everything will work out fine.
Currently I'm not getting any flickering, invisible, or solid transparent surfaces when firing projectiles at a transparent surface, or when particles collide or get close to one.
One other thing, you may need to add a
To find out how to create transparent surfaces for your DIFs with Cartography shop, go here. Since map2dif needs to be recompiled, you will no longer be able to use the export DIF functionality if you have the Cartography Pipeline, and will have to re-export your maps with the new map2dif.
Lastly, one strange issue still exists: Changing to full screen resolution appears to corrupt the transparent textures, and they are not fixed when switching back to windowed mode. I'll see if I can track this down and if so, post any results here.
10/03/2005 (9:18 am)
Ok, we have this working for the most part. Great resource!To follow up on David Grace's comments about getting Mark Harmon's light fix working for the lighting pack: As of lighting pack version 1.3.5, I can't find any reference to SG_INTERIOR_RENDERLIGHTS_3. However, there is an sgRenderLights() function. Make the same changes to that function that Mark suggests for the renderLights() function in his comment, and everything will work out fine.
Currently I'm not getting any flickering, invisible, or solid transparent surfaces when firing projectiles at a transparent surface, or when particles collide or get close to one.
One other thing, you may need to add a
#include "interior/interiorInstance.h"at the top of interiorRender.cc to get Mark's changes to work.
To find out how to create transparent surfaces for your DIFs with Cartography shop, go here. Since map2dif needs to be recompiled, you will no longer be able to use the export DIF functionality if you have the Cartography Pipeline, and will have to re-export your maps with the new map2dif.
Lastly, one strange issue still exists: Changing to full screen resolution appears to corrupt the transparent textures, and they are not fixed when switching back to windowed mode. I'll see if I can track this down and if so, post any results here.
#36
10/19/2005 (8:57 am)
Hello all, I've been gone fer a while (harddrive problems and other things) and I will be cleaning this up and getting it working with TGE 1.4 and try to fix this lighting problem as well.
#37
Linking...
engine.lib(interiorInstance.obj) : error LNK2001: unresolved external symbol "public: bool __thiscall InteriorTrans::Update(void)" (?Update@InteriorTrans@@QAE_NXZ)
engine.lib(interiorInstance.obj) : error LNK2001: unresolved external symbol "public: __thiscall InteriorTrans::InteriorTrans(void)" (??0InteriorTrans@@QAE@XZ)
../tools/map2dif.exe : fatal error LNK1120: 2 unresolved externals
what can be the problem
kindly help
10/28/2005 (12:30 am)
Hi i just tried your resource, but i keep getting some link errorsLinking...
engine.lib(interiorInstance.obj) : error LNK2001: unresolved external symbol "public: bool __thiscall InteriorTrans::Update(void)" (?Update@InteriorTrans@@QAE_NXZ)
engine.lib(interiorInstance.obj) : error LNK2001: unresolved external symbol "public: __thiscall InteriorTrans::InteriorTrans(void)" (??0InteriorTrans@@QAE@XZ)
../tools/map2dif.exe : fatal error LNK1120: 2 unresolved externals
what can be the problem
kindly help
#38
but you should wait for my new version, fixes lots of things :)
10/28/2005 (8:04 am)
you need to add the files to yer LIB project also for map2dif and re-compile it.but you should wait for my new version, fixes lots of things :)
#39
this sounds like a great mod.
could somebody summarize its status with tge 1.3 and the lightingpack ?
11/10/2005 (6:00 pm)
webersoft seems to be missing/down at the mo.this sounds like a great mod.
could somebody summarize its status with tge 1.3 and the lightingpack ?
#40
11/23/2005 (9:45 pm)
Does this allow for transparent interiors (ie., you can see the sky through the walls when you're inside?) 
Torque Owner Christian M Weber
www.webersoft.net/Deus/code_trans.rar
Ok, here it is, I tested it on a clean build