Exporting background scene from blender

Problems building or running the engine, queries about how to use features etc.
ggraf
Gnoblar
Posts: 3
Joined: Wed Feb 28, 2024 11:56 am

Exporting background scene from blender

Post by ggraf »

Ogre Version: 1.8.1
Operating System: Windows 10

Hello,
I'm working on blender 4.0 to create a VR scene environment for rehabilitation purpose using D-Flow software from Motek-Medical running on Ogre 1.8.1 for programming the task.
I'm exporting a scene, it works, but I don't have any background on it when I import the .scene in D-Flow.
Any idea to solve my issue ?

Thanks a lot.

rpgplayerrobin
Orc Shaman
Posts: 792
Joined: Wed Mar 18, 2009 3:03 am
x 452

Re: Exporting background scene from blender

Post by rpgplayerrobin »

If I remember correctly, Ogre 1.8.1 did not have any kind of RTSS which generated shaders for you, so I am not sure at all how Blender actually creates your materials.

If your application has a material per object, you could in Blender just set the material name of the object, and it would use that material in Ogre if you load both the material and the .mesh object (which can contain multiple sub-meshes with different materials of course).

So lets say that you have a cube and a plane that is the background object.
Then you create materials for both of them and name them correctly, something like "cubeMat" and "backgroundMat". Then you make sure that you have .material files in your application that matches those material names.
Then you can export those meshes from Blender either as one big .mesh file or individually.

But since you mention a .scene format, it might be exporting differently, but the same applies regarding that you need to create the materials and such.

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 536
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 198

Re: Exporting background scene from blender

Post by sercero »

Do you have a .scene that when used with D-Flow it shows background?

It would be nice to see what is the difference.

You are mentioning OGRE 1.8 which is ancient. At that time blender2ogre was very different and had some stuff that was removed in time because most people don't use it and it was unmaintained.

You would have to use an old version of blender2ogre perhaps but that would mean also using an old version of Blender as well (like Blender 2.79b, for example).

But first lets see those .scenes, perhaps this can be solved in a better way.

ggraf
Gnoblar
Posts: 3
Joined: Wed Feb 28, 2024 11:56 am

Re: Exporting background scene from blender

Post by ggraf »

Thanks for your both responses.
I'm a begginer in the field so maybe I'm doing something wrong.

I put the EndlessRoad file in the following link, which is the tutorial given by MOTEK for learning Dflow, and Blender_Export which is the simple scene of a green plane with a sky backgroud (I also put the .blend file). I don't understand everything but I see that in the road.scene, there is no call for the background image, unlike the EndlessRoad.scene.

If you think of a solution to automatically export the background, otherwise, I will try to add it by hand to my scene.

https://drive.google.com/drive/folders/ ... sp=sharing

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 536
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 198

Re: Exporting background scene from blender

Post by sercero »

Hello,

With the background you refer to the skybox?

Or is the background some plane?

I have been looking at the blender file you provided and it seems that there is a skybox as a "background" in the world properties.

I guess you want to be able to export that.

The problem is that I don't know if D-Flow is respecting the DotScene DTD.
https://github.com/OGRECave/ogre/blob/m ... tscene.dtd

There is an "environment" element that has a skyBox.

If you have a .scene that loads a skyBox in D-Flow I would be able to help you.

ggraf
Gnoblar
Posts: 3
Joined: Wed Feb 28, 2024 11:56 am

Re: Exporting background scene from blender

Post by ggraf »

Hello,
Yes I use environment texture in world settings to put a background. Maybe it's not the best way ?
Exactly, I want to export in my .scene these information.

I don't know exactly what is done in D-Flow because it's used to create clinical tasks in VR but in the EndlessRoad file (example given by D-Flow creator as training materials), you will find the EndlessRoad.scene which call a skybox.

I will look for other examples if I find other cases of skyboxes importation.
Tell me if you need any other information.
Thank you

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 536
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 198

Re: Exporting background scene from blender

Post by sercero »

I created an issue in blender2ogre repo regarding this problem.
https://github.com/OGRECave/blender2ogre/issues/203

But I don't know if we'll be able to solve it because the skyBoxes in Blender are different than OGREs.

In Blender the skyBoxes are HDRI single images and in OGRE they are 6 images that cover a "box" whose textures is sampled in a way so that it covers the whole "sky".

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 536
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 198

Re: Exporting background scene from blender

Post by sercero »

Hello,

The issue has been resolved in this pull-request:
https://github.com/OGRECave/blender2ogre/pull/239

Let us know.

Best regards.