Blender object exporting trouble

So I can’t figure out how to make the edges of the room more defined. I figure it has something to do with lighting, since I’m using ambient light to hit everything in the scene. However, when I tried messing with directional and spot lights, it didn’t look right. Is there a fix for this within panda, or would I have to go back to my object on blender and mess around?

When exporting via YABEE, perhaps try checking the box labelled “Copy texture files” (and specifying an appropriate directory in the box that should appear; I think that the path that you enter there is relative to the directory into which you export).

What do you mean when you say that it “didn’t look right”? What, precisely, was the problem?

(A screenshot may be useful here.)

Depending on what precisely the issue is, it could be a matter of your lighting choices, modelling or art direction, offhand.

This is how it looks in blender, while this is how it looks in my script. As you can see, the corners blend into each other, making it hard to distinguish the corners of the room. I figure it’s a lighting problem, but I don’t know how to go about fixing it…

I gave up on YABEE because it just wasn’t working. Grr. I am using obj2egg instead. Still, I can’t find a late version, but at least it is giving me something I can work with. Issues though. I tried unwrapping the faces of objects to get the normals thing worked out, bust. No good. Whatever.

Now, I am assigning an image file to the surfaces of some things but with bizarre results. I tried the object and did a cylinder wrap and it is perfect in Blender. Exactly what I want. I export, the strangeness starts. The image map is crunched up on one face, repeated on the next, upside down on the next, missing entirely on the last. When I tried unwrapping the faces and applying it instead of using a cylinder projection, I get the same mess described above. This is a simple cube sort of figure, no rocket science.

For that matter, if it were rocket science, I would be right at home. What I am missing is that Blender and Panda are so different, and each has its own manual and set of assumptions. Panda is either missing something from the file I am giving it, or some basic assumptions are different. POV-Ray I can do literally anything, I have Blender figured out well enough to make the images as I want inside its environment, but exporting to Panda is getting ridiculous. All my time goes to making it look right instead of coding the logic as I should be doing. Something is being lost in the translation.

Cheers!

Looking at the Panda screenshot, it looks as though you’re only using ambient lighting (if that), without a directional light–in which case this is the expected output, I believe. You mentioned having tried a directional light; what did your scene look like in Panda with that?

That’s odd–it works well for me. Did you try it with the appropriate version of Blender, as I suggested?

Ah, in that case I’m afraid that I’m likely to be of little use–I don’t think that I’ve ever used obj2egg, since the exporters–first Chicken, and now YABEE–have generally worked fairly well for me.

This is indeed true, I believe; with YABEE I might be more able to help you, since I have some idea of the usual mistakes made in that translation process with YABEE (things like either missing the “UV as texture” checkbox or not assigning UV coordinates to the model).

My previous mistake was just putting 1 directional light, instead of 2. Now that I’ve added 2, it’s looking much better. However there’s a bug that I can’t seem to fix. For the most part, the walls look nice and clean, but if I turn a particular way they become much brighter until I change my position. Any ideas on what could be doing this? I’ve updated my code above in my previous post.

At a guess, that looks like a specular highlight (if you don’t know what this is, a quick google search should tell you).

I believe that you said that you’re using materials for your colours; in that case, in Blender, go to the “Material” panel (in the “Properties” window) and scroll down to the section labelled “Specular”. There, simply reduce the intensity value to 0.

Of course, why didn’t I check that? :astonished: Thanks for the suggestion!

I fixed all the walls, and removed single key movement (now I can hold down left/right and up/down to move in two directions simultaneously). Before I start adding floor textures, I’m going to attempt to add collisions with the walls. Do you have any advice on how to start this/do this most efficiently?

I’m glad that you’ve made progress. :slight_smile:

Regarding collision, I’m going to presume that you know the basics for whichever system you intend to use (how to set it up, what the collision shapes are, etc.); if not, the manual should be a good place to start. That said, your situation looks fairly straight-forward, and the only things that come to mind that seem worth mentioning are to be careful of fast-moving objects (specifically, that they don’t miss your walls entirely by virtue of great speed) and to watch that you don’t leave gaps where you don’t intend them.

This has been very helpful. Still, my greatest frustration comes from the fact that whatever happens in Blender is done completely differently in Panda. Sure, two teams of people who probably never met made the software for each. But, when I wrap a texture on something in Blender it does pretty much what I expect. When I look in Panda is it totally hosed with respect to face orientation, how it is wrapped, etc. When I do a standard PNG image on-screen in Panda with the transparency attribute set, it totally fails to work, and this is not something from Blender.

I cannot stop the involuntary growling noises I keep making.

I know that I will work this out but time is precious. I spend most of my time not making things and putting them in place but reading through the manuals and cursing, “no, that doesn’t work!” And remember, you don’t need profanity to curse. It’s all in the intention.

Okay, a quick summary of things that still puzzle me.

First, I see that the lighting in the environment is odd in a very specific way. The upper parts of objects are darker than the lower parts. It is as if light is being emitted from below. I have moved light sources around and tried various types but to no avail.

Second, I have a box that I have wrapped a simple texture around. The texture appears upside-down in Panda also. It’s pretty clear that something is being assumed by Panda that I cannot explicitly find in the egg file. The file also has all the textures in it (which you can see very clearly with any editor) but no texture is being assigned to the objects in the scene. Everything has color only. Pview is helpful of course, but it simply gives the same confirmation that everything is illuminated and wrapped upside-down.

I have read a lot of the manual and find things helpful, and the most help comes from seeing the examples that others have done and the discussions here. But it still makes zero sense to me that simple, basic, fundamental things are hosed up. How can this be? I am surely missing something but generally speaking there are logical reasons for things. This is borderline insanity.

I can make a game, sure. I can get things in there and make the do stuff. But the lighting, the textures, the lack of transparency on a png image made in Gimp, even when importing the TransparencyAttrib, all of it adds up to more growling.

I know that nobody wants to hear this. My concern is not just my needs but the fact that this sort of thing is a real turn-off to otherwise capable and creative people who want to work in a medium and cannot get clarity. If I had the time and the backing, I would write a graphic-based tutorial showing exactly how this all fits together. I love that sort of challenge. Anythings that makes the world, even the virtual one, a better place is well worth it.

At this point, perhaps a screenshot would be helpful. Better yet, a screenshot of Panda’s rendering and a screenshot of Blender’s 3D view in wireframe mode (perhaps with vertex normals shown as well).

My guess is that it’s to do with how you’re applying the texture in Blender–not everything in Blender translates simply to Panda, and reasonably so, I think. How are you applying the texture in Blender?

Did you ever try the earlier version of Blender with YABEE, as I suggested? If not, I’d strongly suggest that you do: If I recall correctly, you’re converting first to obj, then from obj to egg, so there are a few places in which problems could crop up. If you can get YABEE working, then there should be fewer potential points of conflict.

I’ve seen this before myself, if I recall correctly. How are you going about displaying your texture? Are you putting it into an OnscreenImage, and if so, are you specifying the “parent” keyword parameter, and if so, with what value?

If you’re not using an OnscreenImage, then what are you doing to show your texture? It may just be a matter of Panda’s 2D reference frame being different to GIMP’s reference frame; in particular, I believe that GIMP has its y-axis increasing downwards (the highest value is at the bottom), while Panda has its (2D) y-axis (or rather, its z-axis, since I believe that z is used for the vertical) increasing upwards (and note that if it didn’t, moving an object upwards would presumably involve decreasing its z-value, which is somewhat unintuitive).

I can understand that, I do believe. The main problem, I suspect, is that working with a 3D engine is very different to working with a modelling program: they have different assumptions, goals and optimisations, and so translating between them without conversion tools such as YABEE can be tricky.

Hi, thanks.

I did try the earlier version of Blender and the issue with YABEE was unabated. Hair-pulling stuff. I also searched everywhere for some later release of YABEE with no luck. Looking at the sources, part say 12.1, part say 12.3, but they came from the same source. Probably nothing really big there but you never know.

The texture issues… I created an image map in Gimp and exported as a .png and it worked perfectly in Blender. I used a number of different methods, each did what I expected. I settled on using cylinder mapping and wrapping it around the figure which is basically a cube made slimmer and taller. It’s a rectangular solid with six faces and 8 vertices, nothing done except to change its scale. The Blender version is perfect.

I export the data, copy the png file into the same directory, and Panda places a copy on each face, mostly. The ones that get it are single copies, tall and narrow and one face is upside-down, the bottom is black (of no actual consequence but maybe helpful to know). I know about uv mapping and using six images to get the faces on and that is my next step.

But, I also went through the unwrapping procedure in Blender to try and make things work with Panda but it gave me that “inside-out” effect. Yeah, back face culling and facing in instead of out.

I am just going to make six files and try that method for now. Does Panda have a cylindrical map option? It would be so simple, even if I had to invert the source. Big deal.

But materials are another thing. I can make a work-around for texture, I have had to do far worse to make things work before. It’s just inelegant. But materials are in the file, are assigned to the polygons, and they do nothing. Clearly I have missed something. This is not part of an on-screen image or anything like that.

But speaking of which, I made a “front end” for the screen that contains object menus and so forth for the player and I created it as a png image and used the black part as the “window” into the game. Transparency would not work. I imported the TransparencyAttrib from the core, did not work. I checked my alpha channel in Gimp, no dice. I used the image in another application, fantastic, it works. I put it in POV-Ray and black is transparent as advertised, made a cut-out from it with no problems.

I used the same .png in Panda and basically got the tail end of the bear. I cannot make any part of the image transparent in Panda. I said screw it, made two pieces from my image and pieced it together as my interface. Fine, crufty but whatever. I then got a wild hare and tried it on my other machines. They agree. Panda does not do it.

I am using Qosmios, top end, for everything. Two of them are brand new. I tried it on the outside chance that I might have had a bad RAM or something stupid. No, all of them agree. I thought that a material could be assigned to a solid figure in Panda but I guess I am wrong. In Blender the walls have warts and crinkles just fine. In Panda everything is uniform cartoonium without character. I mean, I don’t expect photorealism or anything but it should look like something more than play-doh.

I fooled around with point lights and area lights and ambient settings and finally got something that looks okay, just not good enough. I would never release this thing looking so bad. The old Doom looked better.

The thought about the y axis in Gimp is a valid one; most monitors are done that way anyway due to the ancient hardware being memory-mapped. Increasing addresses took you further down the screen. But still, if you know those things, you can work with it. I fully understand that. And yes, Panda does use z as the vertical axis. POV-Ray uses y as vertical. Blender uses z as vertical.

So now I have my walk-through model made and can cruise around inside my little game world, and I ended up remaking some of the solid models to get the lighting right but whatever. I think that from a cold start with Panda AND Blender in just a few days having a working walk-through even in the face of this trouble is pretty good. I started on the 26th.

I also greatly appreciate the advice that you are sharing. Time is money, surely, so thank you.

I’ll get some screen shots together.

That’s very odd. o_0

At this point, I recommend posting your problems with YABEE in the main YABEE thread–the guy who created YABEE (by the name of “ninth”) is probably your best bet for figuring out what’s going wrong.

With regards to the textures being upside-down, my best guess is that one step or another–likely either the obj exporter or obj2egg–is assuming a top-left coordinate system–in which vertical values increase downwards, as in GIMP–where one would expect a bottom-left coordinate system–in which vertical values increase upwards, as in Panda–or vice versa.

Simply tell Blender to reverse (or recalculate) the normals and that should be fixed.

But you said above that you are getting your material colours, didn’t you? Are you not seeing the effects of your settings for diffuse lighting, specular highlights, and so on?

(If you’re referring to textures applied in Blender materials, then I think that such might be a more complex situation, and may require you to either use UV-mapping rather than automatic texture coordinates or do some more work of your own; I’m honestly not sure.)

Do you mean a material or a texture? They’re not the same thing in Panda, I believe.

Do I understand correctly that you’re attempting to use a colour-key for transparency, rather than the alpha channel? If so, then–aside from additive blending, which is unlikely to be appropriate to your case–I’m honestly not sure of how best to go about that in Panda; perhaps you could achieve this using two texture stages…

More simply, have you tried making the black section transparent in GIMP? (That is, instead of solid black, giving it an alpha channel (if it doesn’t have one) and then erasing the parts that are intended to be transparent.) Alpha-transparency should work well in Panda. (It may still call for explicitly setting the transparency attribute; I’m not sure offhand.)

Otherwise, again, how are you displaying this in Panda? Are you creating a quad in Blender and applying it to that? Using OnscreenImage? Something else?

If you’re referring to things like normal mapping, then that calls for shaders, I believe–as well as exporting the normal map, and possibly additional vertex information; I don’t know how that’s achieved using (or even if it’s supported by) the exporters that you’re using, but I believe that it is supported by YABEE (albeit that it calls for explicit instruction to do so). On the Panda side, relatively simple effects like normal mapping are supported via the default shader generator.

It’s my pleasure. :slight_smile:

Honestly, I think that the first thing to do is to get YABEE working for you; I don’t know, offhand, to what degree the exporters that you’re using support what you’re trying to do (or even how much of it the obj format that you’re passing through supports), and I’d like to remove them as a potential source of your problems.

The things that you’re talking about–normal mapping, proper texure mapping, etc. all work in Panda as far as I’ve seen. I export successfully from Blender (albeit using YABEE and with UV-mapped objects).