Parallax mapping messing with totally unreleated textures
-
- Posts: 11
- Joined: Sat Jun 30, 2007 6:50 pm
Parallax mapping messing with totally unreleated textures
Hello, i'm asking for help on an elusive and seemingly irrational bug that bugs me.
First, some background:
I'm writing an adventuregame engine based on irrlicht (for the graphics) and game monkey (for the scripting).
It's pretty meaningless to post code becouse i should write some tonnes of it to explain the things right, but i posted the most interesting parts here in the pastebin: http://pastebin.com/fdb310ac
I needed to implement parallax mapping and other materials for my models, dynamically from the .
I have some arrays that contain PG (player/NPC) structures, and object (in the sense of "a door" like object, not the C++ sense) structures, that contain a mesh, a node and some additional things. further, i have a single node and a single mesh that are the loaded room, an array of textures for access within scripts, and some assorted other things like collision models etc.
I wrote a bunch of subs to bind (that is, to make avaible to use in the scripting language) for game monkey.
The problem is, i done a bunch of subs for manipulating materials generally for all this assorted meshes and nodes and i wanted to test parallax mapping on rooms but got strange problems...
As soon as i enable the parallax on the room node, all my textures, and i mean all of them, gui, cursor, all, of them, get "fused" with the bump texture of the model, like it was theyr alpha channel. it's
if you want some explanation for the poorly commented and messy code, i'm more than willing to give it.
for your reference, each sub starts with a bunch of GM_CHECK_INT_PARAM(variablename, IDnumber) or similar, that is a macro that checks the script passed argument with that ID is (in this case) an integer, and puts it in a variable with that name. GM_CHECK_NUM_PARAMS(paramnum) checks if the number of script passed argument is equal to paramnum. Both macros return an error if the conditions are not met, and GM_CHECK_NUM_PARAMS is optional if you want an whatever-number-of-arguments-function.
objchar is the first parameter of the called sub from script, and is a flag that gets 1 if the array is the one of objs, 0 if the selected thing is a pg, and whatever else for the currently loaded room.
selnum is the array number, if you selected a pg or obj. it does not mean anything if you selected the loaded room.
selmat, is the selected material and sellay is the selected layer.
only the material type screws things up. other material properties does not influence the bug.
i call the setup for the texture one time in global init then i setup room, obviously, every time that room is loaded. if i put that material type for the room, that is EMT_PARALLAX_MAP_SOLID, it screws things.
when i disable parallax mapping, or change room (thus, reloading all and disabling parallax mapping) the problems vanishes and every texture returns to normal. if i disable manually (that is, calling a script on the fly using a hotkey that i set up) the parallax mapping, setting the room to EMT_SOLID, the problem vanishes too.
using a moving light, that flies in circle, i seen the "shadows" blended on the textures in the gui oscillate in intensity following the moving of the light. they seem an alpha blend copy of the parallax map. if i rotate the player and the camera follows, i see the "shadows" oscillate, blink, get completely black, and, sometimes, vanish and all behaves normally until i move again.
this problems are obviously linked with the parallax map. i just cannot pinpoint what problem is there. it's pretty irrational.
I hereby post some screenshots to help you. thank you for reading all of that, and excuse me for my poor english. i hope that someone is generous enough to help me, i'm in a pinch.
EDIT: i tried EMT_LIGHTMAP, EMT_LIGHTMAP_ADD and EMT_DETAIL_MAP. Altrough they tinge the mesh with respectively different eerie blue and cyan colors, they dont give any problems with other textures.
SCREENSHOTS:
Here i'm in a room other than the parallax-problems one and it'all normal. i post it for reference:
Here i'm in the problematic room, and you see the gui and the cursor are blended with the parallax map:
Here i'm in the problematic room, and the camera is rotated-positioned in a "lucky" position where all appears normal, until...
...i rotate the camera again and all the gui gets PITCH BLACK. help me...
First, some background:
I'm writing an adventuregame engine based on irrlicht (for the graphics) and game monkey (for the scripting).
It's pretty meaningless to post code becouse i should write some tonnes of it to explain the things right, but i posted the most interesting parts here in the pastebin: http://pastebin.com/fdb310ac
I needed to implement parallax mapping and other materials for my models, dynamically from the .
I have some arrays that contain PG (player/NPC) structures, and object (in the sense of "a door" like object, not the C++ sense) structures, that contain a mesh, a node and some additional things. further, i have a single node and a single mesh that are the loaded room, an array of textures for access within scripts, and some assorted other things like collision models etc.
I wrote a bunch of subs to bind (that is, to make avaible to use in the scripting language) for game monkey.
The problem is, i done a bunch of subs for manipulating materials generally for all this assorted meshes and nodes and i wanted to test parallax mapping on rooms but got strange problems...
As soon as i enable the parallax on the room node, all my textures, and i mean all of them, gui, cursor, all, of them, get "fused" with the bump texture of the model, like it was theyr alpha channel. it's
if you want some explanation for the poorly commented and messy code, i'm more than willing to give it.
for your reference, each sub starts with a bunch of GM_CHECK_INT_PARAM(variablename, IDnumber) or similar, that is a macro that checks the script passed argument with that ID is (in this case) an integer, and puts it in a variable with that name. GM_CHECK_NUM_PARAMS(paramnum) checks if the number of script passed argument is equal to paramnum. Both macros return an error if the conditions are not met, and GM_CHECK_NUM_PARAMS is optional if you want an whatever-number-of-arguments-function.
objchar is the first parameter of the called sub from script, and is a flag that gets 1 if the array is the one of objs, 0 if the selected thing is a pg, and whatever else for the currently loaded room.
selnum is the array number, if you selected a pg or obj. it does not mean anything if you selected the loaded room.
selmat, is the selected material and sellay is the selected layer.
only the material type screws things up. other material properties does not influence the bug.
i call the setup for the texture one time in global init then i setup room, obviously, every time that room is loaded. if i put that material type for the room, that is EMT_PARALLAX_MAP_SOLID, it screws things.
when i disable parallax mapping, or change room (thus, reloading all and disabling parallax mapping) the problems vanishes and every texture returns to normal. if i disable manually (that is, calling a script on the fly using a hotkey that i set up) the parallax mapping, setting the room to EMT_SOLID, the problem vanishes too.
using a moving light, that flies in circle, i seen the "shadows" blended on the textures in the gui oscillate in intensity following the moving of the light. they seem an alpha blend copy of the parallax map. if i rotate the player and the camera follows, i see the "shadows" oscillate, blink, get completely black, and, sometimes, vanish and all behaves normally until i move again.
this problems are obviously linked with the parallax map. i just cannot pinpoint what problem is there. it's pretty irrational.
I hereby post some screenshots to help you. thank you for reading all of that, and excuse me for my poor english. i hope that someone is generous enough to help me, i'm in a pinch.
EDIT: i tried EMT_LIGHTMAP, EMT_LIGHTMAP_ADD and EMT_DETAIL_MAP. Altrough they tinge the mesh with respectively different eerie blue and cyan colors, they dont give any problems with other textures.
SCREENSHOTS:
Here i'm in a room other than the parallax-problems one and it'all normal. i post it for reference:
Here i'm in the problematic room, and you see the gui and the cursor are blended with the parallax map:
Here i'm in the problematic room, and the camera is rotated-positioned in a "lucky" position where all appears normal, until...
...i rotate the camera again and all the gui gets PITCH BLACK. help me...
Last edited by Dott. Agasa on Sat May 10, 2008 6:47 pm, edited 2 times in total.
-
- Posts: 107
- Joined: Sat Nov 04, 2006 9:42 pm
-
- Posts: 11
- Joined: Sat Jun 30, 2007 6:50 pm
-
- Posts: 11
- Joined: Sat Jun 30, 2007 6:50 pm
-
- Posts: 11
- Joined: Sat Jun 30, 2007 6:50 pm
-
- Posts: 11
- Joined: Sat Jun 30, 2007 6:50 pm
to my utmost regret, i must resume the topic, as the problem has not been resolved due to other problems arising, mostly with sound, and other life problems. i updated some parts of my engine hoping it would solve it, to no avail (i tried to solve problems with allocated textures...). please report if anyone of you had similar experiences and how you solved them... please, help me.
You missed out the most important detail, what video card do you have?
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
-
- Posts: 11
- Joined: Sat Jun 30, 2007 6:50 pm
If you look in the NVidia shader library (On their website in the developer section), there are some alternative parallax mapping shaders you can try.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
-
- Posts: 11
- Joined: Sat Jun 30, 2007 6:50 pm