Pages: 1 2 3 4 »
  Print  
Author Topic: Realtime 3D Shadows, Animations, & Outlined Cel Shading  (Read 7584 times)
Offline (Male) time-killer-games
Posted on: March 08, 2014, 05:39:17 PM

Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1164

View Profile Email
YoYoGames are winning the race. But not for long!
ENIGMA's shaders system is buggy, incomplete, and
completely incompatible with GMStudio. An easy fix;
there are two fantastic shaders on the GMC that no
3D ENIGMA game should be built without:

1) Realtime Dynamic 3D Shadows
2) Realtime 3D Bones & Animations

If we won't support these any time soon that for me
would be a nightmare because ENIGMA's 3D is the
same as GM 8.1 which is terrible and ugly beyond
measure. For anyone to be able to make a serious 3D
game in ENIGMA, these two shaders are a must-have!

Edit: I found another shader that is very useful, but it
isn't near as popular and not as many people would
use it. It's hard to implement due to how it was coded.

3) Outlined 3D Cel Shading

This shader is pretty cool too but it's not as pressing,
we should focus on this one down the road when
there's more important things fixed and out of the way.
I just hope outlined cel shading will be a working part
of ENIGMA at least sooner or later. :)

Your thoughts?
« Last Edit: March 09, 2014, 01:07:03 PM by time-killer-games » Logged
Offline (Unknown gender) TheExDeus
Reply #1 Posted on: March 08, 2014, 07:30:54 PM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
The shadow example - 1) It uses surfaces which sadly aren't functional right now. I have asked people 100x here on how to proceed fixing them. Nobody gave a fuck. I'll probably end up doing it my way, which is recoding all drawing functions to take 1-ty texture coordinates. 2) There seems to be a bug in the parsers something to do with globlavar. We are waiting for ages for Josh to fix it up and include in ENIGMA. Maybe it will take some ages more.

The animation example: It uses custom vertex buffers which we currently don't support. I am not sure how to proceed on that front, as I would have to see how they are used in shaders. I can probably do that. There is a LGM bug though, that shaders are not loaded in LGM in this example https://www.dropbox.com/s/dnjr08n3rliw92n/Morph%20target%20animation.zip . Robert should investigate that. Not sure about that rest.

In short, the shadow example could be easier to implement support for and the same time fix surfaces. I personally use surfaces a lot, so I am very pissed, that they are not working. I have written this in IRC and forums for a while now, but nobody is really willing to listen. As far as I understood Josh wanted me to flip vertical texture coordinates, which might end up as the best solution. That will require modifying all the drawing functions though.
Logged
Offline (Male) Josh @ Dreamland
Reply #2 Posted on: March 08, 2014, 09:27:28 PM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2956

View Profile Email
#define globalbar global var
And as I've said, surfaces being upside-down is an easy fix. If that's what you're on about.

Step one: stop making all the textures upside-down.
Step two: bind the sampler matrix.
Step three: glScalef(1,-1)
Step four: ? ? ? ? ?
Step five: profit
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Unknown gender) TheExDeus
Reply #3 Posted on: March 09, 2014, 11:01:20 AM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
There is maybe another reason for the fail. You should try compiling. I cannot understand why it cannot find defined variables.

Quote
Step one: stop making all the textures upside-down.
Step two: bind the sampler matrix.
Step three: glScalef(1,-1)
Step four: ? ? ? ? ?
Step five: profit
I guess that could work in GL1. It uses texture matrix anyway, so it shouldn't slow the whole thing down. In GL3 though, the texture matrix will have to be in the shader, which would break user shader code (as they wouldn't do the transformation as it's not needed in GM:S).

I suggest this:
Quote
Step one: stop making all the textures upside-down.
Step two: change all texture coordinates in built-in drawing functions to compensate
Step three: change all texture coordinates in the functions that require specifying texture coordinates (like draw_vertex_texture) to flip the user inputed ty coordinate
Step four: ? ? ? ? ?
Step five: profit
This would mean that the fix will work on all GL systems and wouldn't require a different fix for each.
Logged
Offline (Male) time-killer-games
Reply #4 Posted on: March 09, 2014, 12:54:45 PM

Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1164

View Profile Email
Thanks guys for considering it, as I'm sure there's a lot on your plate as is. But though I would love to use these in ENIGMA that wasn't the primary reason in why I posted this. I posted this because these two 3D capabilities are something GM has always lacked, and now that GM can do such things it is a huge breakthrough to the GM community.

If we focussed less on fixing on minor various bugs that may or may not effect whether someone's game would work, and we temporarily focussed all on getting more significant things like this to work, it would definitely skyrocket ENIGMA's popularity if all goes as hoped, which is what I'd really like to see. ENIGMA really deserves the popularity it has always lacked.

Edit: I updated the OP.
« Last Edit: March 09, 2014, 01:10:03 PM by time-killer-games » Logged
Offline (Male) time-killer-games
Reply #5 Posted on: March 09, 2014, 03:16:28 PM

Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1164

View Profile Email
@DarkStar - ENIGMA's 3D works just fine, either someone accidentally broke it in an update, or something is wrong with your code. Daz had a similar problem and he thought it was a bug too but it just turned out he forgot to use draw_set_color(c_white). Literally everything about the 3D used to work for me exactly how it also does in GMS so if your 110% sure your code isn't the problem, file a bug on the tracker, because someone must have broke it by accident and may only need a few lines of code to fix. I'm saying this from experience, once upon a time a month or two ago the 3D behaved EXACTLY the same in ENIGMA as it does in GMS. After you file this bug, it's only a matter of a week before it should be fixed anyway, so nothing to get worked up about.
Logged
Offline (Unknown gender) Darkstar2
Reply #6 Posted on: March 09, 2014, 09:59:58 PM
Member
Joined: Jan 2014
Posts: 1244

View Profile Email
Not my code :)  It is a 3D engine / LIB, the lib display fine, I see all the D&D actions, and it compiles with no errors.  No 3D rendering is done.  The thing works fine in GM.

You mentioned LIB to LGL, how? is there a link to a program to download ? How does that work out?

Right now I think something should be done about the view_port not working as it should, clearly there should be an option to use multi monitor or single, as most people use single and are unable to use view port when it covers an area bigger than the screen res of the user, without imposing / force changing resolution, which is not convenient.


« Last Edit: March 09, 2014, 10:02:55 PM by Darkstar2 » Logged
Offline (Male) Josh @ Dreamland
Reply #7 Posted on: March 09, 2014, 10:02:57 PM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2956

View Profile Email
Harri:
That means you're going to be rewriting all the ENIGMA functions, then modifying all the user-coordinate functions to take 1-y for them. That's pointless. In GL1, there's already a matrix multiply going on; it doesn't matter whether the matrix is the identity or if it effects y = y*-1 + 1. In GL3, it's still in our interest to keep this in the sampler code, even assuming there is no sampler matrix multiply by default (which I am just assuming—the sampler is a very static entity).

Darkstar:
IsmAvatar released a LibMaker for LGM which should be able to import LIB. Robert dug it up here.
« Last Edit: March 09, 2014, 10:05:03 PM by Josh @ Dreamland » Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Male) time-killer-games
Reply #8 Posted on: March 09, 2014, 10:18:16 PM

Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1164

View Profile Email
@ DarkStar - that explains everything, 3D works perfect in pure GML / EDL but I tried using a custom lib recently for my game and it didn't act anything like its code equivalent, so I just ended up using code instead since it wasn't that hard to do.
Logged
Offline (Unknown gender) Darkstar2
Reply #9 Posted on: March 09, 2014, 11:48:28 PM
Member
Joined: Jan 2014
Posts: 1244

View Profile Email
Thanks a lot ! I will give this a try.
Logged
Offline (Unknown gender) Darkstar2
Reply #10 Posted on: March 10, 2014, 12:10:55 AM
Member
Joined: Jan 2014
Posts: 1244

View Profile Email
Still does not work.
I loaded the Basic3D.lib, and saved it to LGL,
removing the LIB.

Same thing.  As with the LIB it compiles fine, I can even see the descriptive text displayed
but no 3D rendered, the room is empty.

BTW while browsing I noticed an Ultimate3D engine, does that work in ENIGMA?
I recall reading that movement did not work, but the post dated 2013, and the link to the ENIGMA extension is no longer available to download, any news on whether this works
now with current ENIGMA version.

Thanks.
Logged
Offline (Male) time-killer-games
Reply #11 Posted on: March 10, 2014, 12:19:35 AM

Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1164

View Profile Email
I don't think you read my post - custom DND whether lib or lgl if they aren't libs that are automatically shipped with ENIGMA they won't work, as simple as that. You need to use code instead if you want to get anywhere with 3D at the moment.
Logged
Offline (Unknown gender) Darkstar2
Reply #12 Posted on: March 10, 2014, 12:33:57 AM
Member
Joined: Jan 2014
Posts: 1244

View Profile Email
(confused) so are you saying 3rd party libs is broken ? If I can't use 3rd party LIBs then what's the use of the library maker and them being recognized by LGM ?

You see I am not yet advanced in coding,
I have lots to go, but seeing I cannot use D&D
libs I guess then I am looking for something similar to Basic3D, or more advanced, that I can USE in ENIGMA, I guess those would be scripts..... Something to render v/h walls, control lighting, models, collision, mouse look, sky map, shadow, etc.

and TKG yes i read your post, I assumed when you said you used LIB and it didn't work, that perhaps if I used an LGL it would.

Guess not.

Also noticed when objects or anything
starts with a number,it fails to compile,
example, 4wallbuilding, so I renamed it
to FWallbuilding.  Guess I will keep that
in mind not to use LIB/LGL if they don't work :D   Was it something that worked before?

Logged
Offline (Male) time-killer-games
Reply #13 Posted on: March 10, 2014, 06:35:39 AM

Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1164

View Profile Email
I don't know if it ever worked I just know it doesn't work right now.
Logged
Offline (Unknown gender) TheExDeus
Reply #14 Posted on: March 18, 2014, 05:19:03 PM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
Quote
That means you're going to be rewriting all the ENIGMA functions, then modifying all the user-coordinate functions to take 1-y for them. That's pointless. In GL1, there's already a matrix multiply going on; it doesn't matter whether the matrix is the identity or if it effects y = y*-1 + 1. In GL3, it's still in our interest to keep this in the sampler code, even assuming there is no sampler matrix multiply by default (which I am just assuming—the sampler is a very static entity).
In GL3 this is a bad solution because we want our shaders to be compatible with GM:S. This means that if a person samples a texture with a custom sampler in his code, then he shouldn't be doing 1-y in his code. In GL3 there is only 1 line that needs to be changed, as everything with textures are drawn via model class. That means "void AddTexture(gs_scalar tx, gs_scalar ty)" in GL3modelstruct.h is the only function that needs to be changed. I will try to do that GL1 matrix thing and then change that GL3 function to see if it works. It won't be the best solution and no way the fastest, but it would be the most "correct" taking into account compatibility and usability.
Logged
Pages: 1 2 3 4 »
  Print