TheExDeus
|
|
Posted on: July 31, 2012, 10:22:46 am |
|
|
Joined: Apr 2008
Posts: 1860
|
poly, I think you made 3d model functions. Are they actually working? Is 3d working at all? Because I get some very weird problems with it. For example, this works fine in GM, but not in ENIGMA. I know culling doesn't work, but even if I remove it is still buggy. You should be able to see 4 shapes and move around with arrow keys. I see part of these shapes and when I move around they distort. What could be the problem? I want to render a point cloud, but if I can't get basic shapes going I don't see how I could do that.
|
|
« Last Edit: July 31, 2012, 01:42:10 pm by HaRRiKiRi »
|
Logged
|
|
|
|
polygone
|
|
Reply #1 Posted on: July 31, 2012, 12:00:55 pm |
|
|
Location: England Joined: Mar 2009
Posts: 794
|
Models should but working, reup the file it's messed.
|
|
|
Logged
|
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
|
|
|
|
polygone
|
|
Reply #3 Posted on: July 31, 2012, 02:21:13 pm |
|
|
Location: England Joined: Mar 2009
Posts: 794
|
The problem is just with the code execution order, in the controller move the step code to the draw event and set it's depth to 2000. I didn't even know projection code worked in the step event in GM, but we're not going to be seeing that in ENIGMA. Unless hmm, what would happen if you set the projection at the end of the draw event instead of the start or it?
|
|
« Last Edit: July 31, 2012, 04:16:10 pm by polygone »
|
Logged
|
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
|
|
|
TheExDeus
|
|
Reply #4 Posted on: July 31, 2012, 04:32:42 pm |
|
|
Joined: Apr 2008
Posts: 1860
|
Fair enough. Though the problem was also connected with having d3d_start and a lot of other d3d_ functions for every shape, so it was executed 4 times. As the shapes had lower depth they were executed first. Putting everything in correct place it worked. Also, I am happy that I can render a 300k point cloud with 0 performance hit. Good job with using gl lists. edit: Though d3d_model_vertex_color don't seem to work properly. I can set one color (like c_lime), but if I set different colors for different vertices, then it doesn't draw anything... edit2: Found the problem. Is with the __GETR, __GETG, __GETB functions inside GSd3d.cpp. You need to divide the values with 255 because GL color is from 0 to 1, not from 0 to 255. So the correct code should be: #define __GETR(x) ((x & 0x0000FF))/255.0 #define __GETG(x) ((x & 0x00FF00)>>8)/255.0 #define __GETB(x) ((x & 0xFF0000)>>16)/255.0 Commit a fix if you want.
|
|
« Last Edit: July 31, 2012, 04:52:38 pm by HaRRiKiRi »
|
Logged
|
|
|
|
polygone
|
|
Reply #5 Posted on: July 31, 2012, 04:44:36 pm |
|
|
Location: England Joined: Mar 2009
Posts: 794
|
I noticed that, that's why I said to set the depth to 2000; it didn't make any difference when the projection was set in the step event. I've just tested moving the projection settings to the end of screen_redraw and it makes it work, I'm not sure if there will be any ramifications to doing that or not.
|
|
|
Logged
|
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
|
|
|
|
polygone
|
|
Reply #7 Posted on: July 31, 2012, 04:56:39 pm |
|
|
Location: England Joined: Mar 2009
Posts: 794
|
Well I think moving the projection settings to the end of the screen_refresh will make things compatible with GM and allow setting the projection and such in events other than the draw event.
|
|
« Last Edit: August 13, 2012, 11:30:10 am by polygone »
|
Logged
|
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
|
|
|
|
polygone
|
|
Reply #9 Posted on: August 02, 2012, 10:29:32 am |
|
|
Location: England Joined: Mar 2009
Posts: 794
|
It wasn't that neat and you can replicate it by just not setting the 3d projection.
|
|
|
Logged
|
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
|
|
|
|
|
TheExDeus
|
|
Reply #12 Posted on: August 02, 2012, 11:19:37 am |
|
|
Joined: Apr 2008
Posts: 1860
|
Well its usually just: Exception in thread "Thread-6" java.lang.NullPointerException at org.enigma.EnigmaRunner$3.run(EnigmaRunner.java:173) At the beggining. But if I try do anything now, like File->New, then I get this. I can replicate it 100% of the time and I had it for years. Its not that big of a problem, but sometimes it launches for a longer time than others, and if I rush and try to open a project then I have to restart everything.
|
|
|
Logged
|
|
|
|
|
|