Page MenuHome

Blender2.8 BGE: Restore part of old bge in 2.8
AbandonedPublic

Authored by Ulysse Martin (youle) on Apr 14 2017, 4:34 AM.

Details

Summary

**The goal of this revision is just to have a "reference" commit in blender2.8 git log to know that at this moment, the BGE was ~working.

**This just restores mesh visibility + physics

  • This will give us the possibility to see what is working or not.
  • Make tests from this commit.
  • If the default cube is not drawn, we will know that something happened since now.
  • This will make git bisect easier (reference commit).
  • List of what is working:

Mesh render works in va+dl and vbo
Textures: Work in some cases
World: horizon color rendered
Lighting: works in some case
Modifier Subsurf works
In multitexture mode, the object matrix seems correct
Logic: Seems to work
Physics: Seems to work with this patch
Animations: Seems to work

  • List what is not working anymore.

2D texts: Crash
3D texts: Crash when we add in the viewport
Wrong object matrix (scale 1, position center, orientation 0) in GLSL mode
In GLSL for now, this doesn't work well. I guess this is normal

Diff Detail

Event Timeline

Ulysse Martin (youle) edited the summary of this revision. (Show Details)Apr 14 2017, 9:34 AM

The goal of this commit is not to be "exact"/"accurate" with new layer system. It's just to restore visibility of meshes so we can do tests and have a reference in blender2.8 git log.

As far I understood the layer system is not yet fully implemented, so I added bool isInActiveLayer = (base->flag & BASE_VISIBLED) != 0; that makes all objects of a collection visible. When we click on they eye beside collection, this makes all the objects invisible.

So, @Porteries Tristan (panzergame) and @Dalai Felinto (dfelinto), if you agree to commit this, this is cool, we can begin to make few experiments in blender2.8 :)

For me the modification is correct.

source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
219

You should remove this commented code.

This revision is now accepted and ready to land.Apr 19 2017, 4:48 PM
Ulysse Martin (youle) edited the summary of this revision. (Show Details)Apr 19 2017, 5:04 PM
Ulysse Martin (youle) updated this revision to Diff 8670.

Removed commented code.

Ulysse Martin (youle) edited the summary of this revision. (Show Details)Apr 19 2017, 5:05 PM
Ulysse Martin (youle) edited the summary of this revision. (Show Details)Apr 21 2017, 7:13 AM
Ulysse Martin (youle) updated this revision to Diff 8677.

restored physics

source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
225

@Ulysse Martin (youle): Is this code needed for blenderplayer too ?

source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
225

@Porteries Tristan (panzergame): I guess yes.

(Parenthesis: I didn't even compiled the blenderplayer because my goal was not to restore completely the old game engine.

I just wanted:

  1. point the things that will cause problems if/when we'll merge upbge.
  2. Have a reference commit to make bisect easier.

The point 2) is the most important to me because when you make bisect you have to know the moment where a thing was working or not. So for many things, this commit will be the "git bisect good" reference. If something is broken again, we will know that at this moment it was good.

BUT: If you want to add more code and restore more things, try to make blenderplayer work etc, I also agree if you want.)

Dalai Felinto (dfelinto) requested changes to this revision.Apr 21 2017, 1:02 PM
Dalai Felinto (dfelinto) added inline comments.
source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
226

We really don't want to duplicate code like this. See rBc7f00feabaa334cd839a9e7904ee0fc1b8d8d718

This revision now requires changes to proceed.Apr 21 2017, 1:02 PM
source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
226

@Dalai Felinto (dfelinto): http://pasteall.org/349966

/* temporary hacky solution waiting for CoW depsgraph implementation */
#define DEG_OBJECT_ITER(sl_, instance_) \
{ \
/* flush all the depsgraph data to objects */ \
Object *instance_; \
Base *base_; \
for (base_ = (sl_)->object_bases.first; base_; base_ = base_->next) { \

	    if ((base_->flag & BASE_VISIBLED) != 0) {                             \
	        instance_ = base_->object;                                        \
	        instance_->base_flag = base_->flag;                               \
	        instance_->base_collection_properties = base_->collection_properties;

#define DEG_OBJECT_ITER_END

It's temporary solution. In upbge we BL_KetsjiEmbedStart almost doesn't exist anymore anyway... If I remove this code, physics doesn't work anymore.

Nevermind, I'll read your today's commit and try to understand what I need to change.

I'm parano or....?

Ok, I'm very sorry about my reaction. It is caused by health problems and tiredness. @Porteries Tristan (panzergame): If you want, you can commandeer this revision until I'm better. Or I'll do requested changes when I'll be better.

This revision now requires changes to proceed.Apr 21 2017, 10:21 PM