free compiler with lightmaps?
Collision works fine (just like with Q3 BSP). I have not problems with it.
But as i told many things has to be done, to be able export from MAX (lights, transparent materials, animation!!!! e.t.c).
Its possible create in max transparent stuff (like portals, flame or other) an then get them into Irrlicht.
But as i told many things has to be done, to be able export from MAX (lights, transparent materials, animation!!!! e.t.c).
Its possible create in max transparent stuff (like portals, flame or other) an then get them into Irrlicht.
works like a charm. Even with Irr0.7 and VC7. I got a question though, what's the Ilogger for?
I made some changes to your main.cpp file:
better said, I added some stuff (the usual stuff I use) and separated the code into parts.
great work. This option as a lightmapper was completely unexpected! Tomorrow I'll have fun with this!!!
cheers!
ps. I created it as a new project in Relo and linked everything to the 0.7 source and evrything is working fine. Very good job.
I made some changes to your main.cpp file:
Code: Select all
#include <irrlicht.h>
#include <stdio.h>
#include <windows.h>
#include "CMY3DMeshFileLoader.h"
using namespace irr;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#pragma comment(lib, "Irrlicht.lib")
ILogger* logger=NULL;
//-----------------------------------------------------------------------------------------------//
int main()
{
IrrlichtDevice *device =
createDevice(video::EDT_DIRECTX9, core::dimension2d<s32>(640, 480),false,false,false,0);
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
io::IFileSystem *fs = device->getFileSystem();
logger = device->getLogger();
//-----------------------------------------------------------------------------------------------//
scene::IMeshLoader *my3dloader = new scene::CMY3DMeshFileLoader(fs,driver);
smgr->addExternalMeshLoader(my3dloader);
scene::IAnimatedMesh* mesh = smgr->getMesh("test/test.my3d");
scene::ISceneNode* node = 0;
if (mesh)
node = smgr->addOctTreeSceneNode(mesh->getMesh(0));
//-----------------------------------------------------------------------------------------------//
//wasd navigation
SKeyMap keyMap[8];
keyMap[1].Action = EKA_MOVE_FORWARD;
keyMap[1].KeyCode = KEY_KEY_W;
keyMap[3].Action = EKA_MOVE_BACKWARD;
keyMap[3].KeyCode = KEY_KEY_S;
keyMap[5].Action = EKA_STRAFE_LEFT;
keyMap[5].KeyCode = KEY_KEY_A;
keyMap[7].Action = EKA_STRAFE_RIGHT;
keyMap[7].KeyCode = KEY_KEY_D;
//-----------------------------------------------------------------------------------------------//
scene::ICameraSceneNode* camera = 0;
camera = smgr->addCameraSceneNodeFPS(0,80.0f,300.0f,-1, keyMap, 8); //1st value= obligatory 0-2nd value= mouse sensitivity-3rd value handles cam speed
camera->setPosition(core::vector3df(-150,70,-70)); //1st=pos in x-2nd value= spawn height-3rd=pos in y
camera->setFarValue ( 50000.0f ) ; //sets the distance for the clipping plane, the bigger the farther
camera->setFOV(1.1f); // a value of 0.5 makes it look alienish
camera->setTarget( core::vector3df(-150,70,0)); //target camera position-3rd value negative =90, positive=0 -1st value (-) rotates camera
camera->setRotation(core::vector3df(0,90,0)); //rotate the camera x,y,z degrees
//-----------------------------------------------------------------------------------------------//
device->getCursorControl()->setVisible(false);
//-----------------------------------------------------------------------------------------------//
int lastFPS = -1;
while(device->run())
{
driver->beginScene(true, true, video::SColor(0,0,0,0));
smgr->drawAll();
driver->endScene();
int fps = driver->getFPS();
if (lastFPS != fps)
{
wchar_t tmp[1024];
swprintf(tmp, 1024, L"MY3D Mesh Loader Example - Irrlicht Engine v.0.7 (fps:%d) Triangles:%d",
fps, driver->getPrimitiveCountDrawn());
device->setWindowCaption(tmp);
lastFPS = fps;
}
}
device->drop();
return 0;
}
great work. This option as a lightmapper was completely unexpected! Tomorrow I'll have fun with this!!!
cheers!
ps. I created it as a new project in Relo and linked everything to the 0.7 source and evrything is working fine. Very good job.
Last edited by afecelis on Wed Sep 15, 2004 3:30 am, edited 1 time in total.
One last thing:
MAX creating cool lighting maps, but..... not all shadows info included in it (you'll see that some shadows messed up).
MAX creating cool shadowmap textures, but.... not all lighting info included in it.
What we have to do in that case???
Simple!!!!
In MAX/images after rendering into (lightingmaps and shadowmaps) textures we have *LightingMap.tga and *ShadowMap.tga.
And to get best quality lightingmaps we have to do this:
*LightingMap.tga + *ShadowMap.tga -> *LightingMap.tga( super quality lighting maps with cool shadows)
You can do this in Photoshop,
or write you own convertion utility, which allowed you merge two images into one.
The formula you needed for that:
(R1,G1,B1,A1) - pixel color in the 1st map (lightings);
(R2,G2,B2,A2) - pixel color in the 2st map (shadows);
(Rc, Gc, Bc, Ac) - - pixel color in the complex map (lighting+shadows);
Rc = R1*R2/255; Gc = G1*G2/255; Bc = B1*B2/255; Ac = A1*A2/255;
Its a last step
--------------------------------------------------------------------------------
@LordTrancos: Why did you sayd that it will be last version of LMTools???
MAX creating cool lighting maps, but..... not all shadows info included in it (you'll see that some shadows messed up).
MAX creating cool shadowmap textures, but.... not all lighting info included in it.
What we have to do in that case???
Simple!!!!
In MAX/images after rendering into (lightingmaps and shadowmaps) textures we have *LightingMap.tga and *ShadowMap.tga.
And to get best quality lightingmaps we have to do this:
*LightingMap.tga + *ShadowMap.tga -> *LightingMap.tga( super quality lighting maps with cool shadows)
You can do this in Photoshop,
or write you own convertion utility, which allowed you merge two images into one.
The formula you needed for that:
(R1,G1,B1,A1) - pixel color in the 1st map (lightings);
(R2,G2,B2,A2) - pixel color in the 2st map (shadows);
(Rc, Gc, Bc, Ac) - - pixel color in the complex map (lighting+shadows);
Rc = R1*R2/255; Gc = G1*G2/255; Bc = B1*B2/255; Ac = A1*A2/255;
Its a last step
--------------------------------------------------------------------------------
@LordTrancos: Why did you sayd that it will be last version of LMTools???
Last edited by ZDimitor on Wed Sep 15, 2004 3:30 am, edited 4 times in total.
-
- Posts: 124
- Joined: Sun Jun 27, 2004 11:02 am
- Contact:
ZDimitor: Awesome work I'm no artist but I can appreciate the programming I got a potentially better solution to that problem you mentioned... Instead of combining 2 images, why not just load them both? It's definatly possible and would be a cool addition to Irrlicht. Actually... I think Irrlicht can already load multiple images per mesh... Isn't that done in the SpecialFX demo?
2.8GHz P4 with HT - 512MB DDR - ATI Radeon 9600XT 256MB - Windows XP - VC++ 6 and VC++ 2003
Dark Reign 3 Home Page: http://darkreign3.notwhatyouthink.org/
Dark Reign 3 Forums: http://notwhatyouthink.org/darkreign3bb/
Dark Reign 3 Home Page: http://darkreign3.notwhatyouthink.org/
Dark Reign 3 Forums: http://notwhatyouthink.org/darkreign3bb/
looks like merging em in adobe ps or gimp would rather easy, if is actually possible is seconds for any artist....
congrats
congrats
Finally making games again!
http://www.konekogames.com
http://www.konekogames.com
Well, I'm very interested in your example, but this link doesn't seem to work (for me)...ZDimitor wrote:Here you go!
It take not more than a half hour, and here is my new implementation of MeshLoader (Irr.0.6), example and test scene (ss you have seen).
http://zdimitor.nm.ru/MY3DExample.zip
Have fun .....
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java