OCT+Parallax mapping MOD

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

OCT+Parallax mapping MOD

Post by omaremad »

Ok here is a "test drive" :wink: of a level created using the OCT Tools workflow, the level is lightmapped via fsrad and is created in blender
(I dont now why not many people use this workflow even though its 100% free and provides radiosity(unlike deled))

More importantly it shows my new level paralax mapper: normal parallax mapping in irrlicht works on non lightmapped single textured meshes, it also required generation of normal and parallax maps.

My Mod generates all the textures on the fly from the diffuse textures, it doesnt modify any mesh loaders so it can be used with bsp deled etc...

it is a mod therefore you would apply the material in the same way, no callbacks to setup etc...

have fun with it, but more importantly comment on artefacts or anything that looks bad befre i provide the final patch.

there is a green static light and a yellow camera light.

Image

omaremad.gdlib.net/octpara.zip

The fps is low because the whole level is rendered, as of now i cant get octree working on tangent meshes.
krama757
Posts: 451
Joined: Sun Nov 06, 2005 12:07 am

Post by krama757 »

I tried to get all the required tools to make this work...its just annoying. Lots of searching on the web...and my workflow is still not complete. So I gave up...
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post by omaremad »

it doesnt modify any mesh loaders so it can be used with bsp deled etc...
it works on any kind of light mapped mesh...., its a demo, ill release a patch if people like it

run it in opengl
Zar
Posts: 29
Joined: Mon Aug 07, 2006 4:46 pm
Location: Brazil

Re: OCT+Parallax mapping MOD

Post by Zar »

omaremad wrote:Ok here is a "test drive" :wink: of a level created using the OCT Tools workflow, the level is lightmapped via fsrad and is created in blender
(I dont now why not many people use this workflow even though its 100% free and provides radiosity(unlike deled))
omaremad,

I've tried to use it, because I want to make most of my modelling with Blender, but this workflow is driving me crazy.

When I export my scene with OCT exporter and pass it trough FSRad nothing happens.

Can you help me with this? I don't now if my OCTTools are not updated or if the problem is with FSRad. Can you post a link to both FSRad and OCT exporter for Blender 2.42?

Do you know any step-by-step tutorial with this workflow?

Thanks a lot.
Last edited by Zar on Wed Sep 06, 2006 12:56 am, edited 1 time in total.
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

working fine here. Interesting, Omaremad. OCT would be the true, free and only great alternative for lightmapping levels created in blender.

Hope to see this project evolve. I'll retake OCT, I think I left it exactly with you UV mapping script. :wink:
Zar
Posts: 29
Joined: Mon Aug 07, 2006 4:46 pm
Location: Brazil

Post by Zar »

afecelis,

Here is the problem:

My test mesh was already created in Blender and successfuly loaded into Irrlicht as obj file, including UV maps.

First of all, I have added a spotlight to the scene in Blender (I read that only spotlight works) aiming a small part of my mesh.

Then I exported it using oct exporter. The resulting file has 519Kb, but I think is normal, because when I export as obj the resulting file has 368Kb.

Then I load the file into FSRad e run it. It start to run, but stop on this screen:
Iterations: 0
Initial (abs/esc) energy: [processing lights]
Energy remaining: 0
Convergence target: N/A (direct light only)
Energy shot this pass: 0.00
Form Factor calculation method: Point Light Estimation
Input file: tower.oct
Adaptative subdivision treshold: 15 (1.#IO% there)
Total patches: 4576 (cur 4x4, max 128x128)
Total elements: 12267
Some files are created in the original oct file directory - the output.oct, a completely back lightmap_0.tga and a 0 - 128x128.raw

When I try to load the output.oct into FSRad Viwer, the mesh is completely black.

When I try to load into Irrlicht, the mesh don't show up and the log says that the corresponding texture could not be loaded (but it is loaded when I use the same mesh as obj)

Could you help me with Blender/FSRad workflow? I really want to be able to use lighmaps with blender, but I'm stuck with this.
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

Hi Zar, did you check this thread?
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=14441
It's where Omaremad posted his UV mapping script and where my interest in Oct returned. Check it and let me know if you find anything useful there, meanwhile I'll experiment myself with a level and tell you if I had any success. Believe me I'd also love to get blender+OctTools to work fine with Irrlicht! :wink:
Zar
Posts: 29
Joined: Mon Aug 07, 2006 4:46 pm
Location: Brazil

Post by Zar »

afecelis wrote:Hi Zar, did you check this thread?
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=14441
It's where Omaremad posted his UV mapping script and where my interest in Oct returned. Check it and let me know if you find anything useful there, meanwhile I'll experiment myself with a level and tell you if I had any success.


Hi afecelis,

yep, I already use automapuv and followed omaremad mini tutorial.

I've solved the problem with the texture not being loaded. Don't know why, but when I export as oct instead of obj, the file try to load the texture from the project root directory instead of my textures path. But even with a succesful loaded texture, the mesh don't show up when using oct.
Believe me I'd also love to get blender+OctTools to work fine with Irrlicht! :wink:
I've been reading all your posts about Blender and I'm loving it. Blender is a little bit scary in the beginning (too many features and controls), but when you get used to it you realize that the interface is very productive. I don't want to use any other program :wink:
Zar
Posts: 29
Joined: Mon Aug 07, 2006 4:46 pm
Location: Brazil

Post by Zar »

I have "successfully" loaded my exported oct file into omaremad example (octpara.zip), but with messed UV map and lights.

So, it seems that I have 2 problems:

1) my Irrlicht.dll is not loading the oct file

2) my exported oct file mess with UVmap

I tried to compile the engine again, using COCTLoader.h e COCTLoader.cpp from the svn update, but had the same problem.

Tried the irrlicht.dll from 1.1 release and another with directX suport, but had the same problem.

To load the oct file can I use "IAnimatedMesh" or there is any special code?

I'm trying to update OCTTools, but www.constantthought.com page is blank. Does someone now where I can get these files?
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post by omaremad »

Did any one like the new parallax mapper? Switch over to bump maping in the demo and it shows how the old parallax maper would have behaved when using lightmapped meshes with multiple tetures.

anyway irrlicht comes with murphy's loader built in so no need for compiling, and besides the dll i provided is custom made since i had to modify the built in asm shaders and some other stuff in the vertex types, opengl driver.

ouch murphy's site is down. lucky i have the tools in backup, any way you get fsrad from fluid studios(google it)

and the exporter script for blender is mirrored here:
omaremad.gdlib.net/oct_export.py

right click save since formatting is important in python


oct should pack the lightmaps in one file but maybe you chose the raw option for debugging?

Only point lights work so maybe you had no lights(0 energy in your pasted output = no valid lights)

maybe i should make a video tut, but it ill be 640*480 bc im using an ancient fraps(cant get the opensource ptogram one to work with blender)
Zar
Posts: 29
Joined: Mon Aug 07, 2006 4:46 pm
Location: Brazil

Post by Zar »

omaremad wrote:oct should pack the lightmaps in one file but maybe you chose the raw option for debugging?

Only point lights work so maybe you had no lights(0 energy in your pasted output = no valid lights)
I was using spot lights instead of lamp lights. One problem solved. Thanks a lot. Sometimes is hard to be a noob :shock:
omaremad wrote:anyway irrlicht comes with murphy's loader built in so no need for compiling, and besides the dll i provided is custom made since i had to modify the built in asm shaders and some other stuff in the vertex types, opengl driver.
I can't figure out why I still can't get my mesh displayed with the built in loader.

Here is my scene node:

Code: Select all

IAnimatedMesh* example = 0;
	example = smgr->getMesh("./media/meshes/output.oct");
	
	ISceneNode* examplenode = 0;
	examplenode = smgr->addAnimatedMeshSceneNode(example);
	examplenode->setScale(vector3df(80,90,80));
	examplenode->setPosition(core::vector3df(0,74,330));
	examplenode->setRotation(core::vector3df(270,270,0));	
	examplenode->setMaterialFlag(video::EMF_LIGHTING,true);
	examplenode->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true);
	examplenode->setMaterialFlag(EMF_FOG_ENABLE,true); //enables fog	
ouch murphy's site is down. lucky i have the tools in backup, any way you get fsrad from fluid studios(google it)

and the exporter script for blender is mirrored here:
omaremad.gdlib.net/oct_export.py
Thanks a lot. It seems that my file versions were OK.
maybe i should make a video tut, but it ill be 640*480 bc im using an ancient fraps(cant get the opensource ptogram one to work with blender)
That would be great! The resolution of your tutorial dosn't matter. Trust me. I think a lot of people would love to have something to start, even with low res.
Zar
Posts: 29
Joined: Mon Aug 07, 2006 4:46 pm
Location: Brazil

Post by Zar »

afecelis,

I've found a link to your OCTTools_1.0.1 (a little bit old version)

So, I replaced the COCTLoader files and compiled a new test version of Irrlicht.dll.

Then I used the example provided in the readme.txt like below, but I can't compile my project with this code.

Code: Select all

irr::scene::COCTLoader OCTLoader = irr::scene::COCTLoader(driver);
smgr->addExternalMeshLoader(&OCTLoader);

scene::IAnimatedMesh* mesh = smgr->getMesh(meshName);
smgr->addOctTreeSceneNode(mesh);

// Do this next part if you want dynamic lights
io::IReadFile* file = device->getFileSystem()->createAndOpenFile(meshName);
OCTLoader.OCTLoadLights(file, smgr);
file->drop();
Is this right?
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

Hi Zar,
I'm not sure if that's the latest version, and I just visited Murphy's OCT site but the it seems to be down. Let me check if I have a newer version.

About loadin the oct file, it should be loaded as ani IAnimatedMesh. The problem, and you already mentioned it, is that it only finds the oct file and the textures when placed at the same fodler as the executable's. Omaremad had a fix to make it find the Oct file+textures in subfolders but I never got it to work.

This code should work:

Code: Select all

//load oct scene
	IAnimatedMesh* octMesh = smgr->getMesh("level.oct");
	ISceneNode* octnode = smgr->addOctTreeSceneNode(octMesh->getMesh(0));
	octnode->setScale(core::vector3df(3,3,3));
	octnode->setPosition(core::vector3df(0,0,0));
	octnode->setMaterialFlag(EMF_LIGHTING, false);
hope it helps. I'll see if I find another verison of oct. :wink:

@Omaremad: I love your parallax mapping mod! Looks great. Did you post any code to use it?
Last edited by afecelis on Thu Sep 07, 2006 1:24 am, edited 2 times in total.
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

Zar, just found version 1.02 which seems to be the latest. I'm also including the Oct viewer. You can grab it here:
http://afecelis.gdlib.net/Irrlicht/Oct_1.02.zip
Zar
Posts: 29
Joined: Mon Aug 07, 2006 4:46 pm
Location: Brazil

Post by Zar »

HOOAH!! It works!!! 8)

afecelis and omaremad, thanks a lot for your help and sorry for spamming your paralax mapping thread with my problems. I still have minor issues with UV map, but nothing that I can't handle with the "search button" :D

Thanks again!
Post Reply