Author Topic: Vortex2 beta released - 3D module  (Read 1386 times)

Offline JaviCervera

  • Jr. Member
  • **
  • Posts: 23
Re: Vortex2 beta released - 3D module
« Reply #30 on: December 05, 2017, 09:21:40 AM »
Looks good. Is this with the environment mapping?

Btw, I was wondering how it would be easy to integrate 2D frameworks or standard mojo 2D commands on top. Does it need some refactoring or I could just use it directly? thanks.

It only uses env mapping on the glass, the rest is achieved through normal and specular mapping. I am considering the ability to use a material's cubemap as the source for specular reflections, which could give great results.

Vortex2 supports Mojo2 directly. You can even paint Mojo graphics to a texture and render them on a Vortex2 mesh. Check the "test_mojo2.cxs" example.

Offline RonTek

  • Sr. Member
  • ****
  • Posts: 311
Re: Vortex2 beta released - 3D module
« Reply #31 on: December 05, 2017, 10:59:30 AM »
Looks good. Is this with the environment mapping?

Btw, I was wondering how it would be easy to integrate 2D frameworks or standard mojo 2D commands on top. Does it need some refactoring or I could just use it directly? thanks.

It only uses env mapping on the glass, the rest is achieved through normal and specular mapping. I am considering the ability to use a material's cubemap as the source for specular reflections, which could give great results.

Vortex2 supports Mojo2 directly. You can even paint Mojo graphics to a texture and render them on a Vortex2 mesh. Check the "test_mojo2.cxs" example.

Thanks. I was trying to use 2D Frameworks like Pyro, but it does not seem to work out of the box. It would be nice to get some 2D GUI working instead of building one from scratch. I'll check out the Mojo2 example again.

I downloaded the latest version and now getting uniform errors on mobile:

Code: [Select]
I/[Monkey]( 3607): Error: Vertex shader active uniforms exceed MAX_VERTEX_UNIFORM_VECTORS (253).
I have to try out some stuff with the working version and SLotman's patch for now..

Offline JaviCervera

  • Jr. Member
  • **
  • Posts: 23
Re: Vortex2 beta released - 3D module
« Reply #32 on: December 05, 2017, 01:16:00 PM »
I reduced the number of varyings required like on SLotman's patch, so that shouldn't be a problem. The issue that you are having means that the number of uniforms (another type of shader var) has been exceeded. You can fix that by initializing the World like this:

World.Init(0, 4)

But that will disable skeletal animation (I am making changes to how this works for beta2).

Offline RonTek

  • Sr. Member
  • ****
  • Posts: 311
Re: Vortex2 beta released - 3D module
« Reply #33 on: December 05, 2017, 02:22:10 PM »
I reduced the number of varyings required like on SLotman's patch, so that shouldn't be a problem. The issue that you are having means that the number of uniforms (another type of shader var) has been exceeded. You can fix that by initializing the World like this:

World.Init(0, 4)

But that will disable skeletal animation (I am making changes to how this works for beta2).

Thanks Javi. Yes, actually I have some background with shader stuff like uniforms, etc, but not to the extent on working with a whole engine basic shaders. I think the setup was better before as it is much easier. I already created some profiles depending on the platform using SLotman's patch and before the specular and cubemap changes that I noticed on the latest version, although the new specular is a great update.

I also got World.Init(1,50) which works perfectly before the changes and with max of 4 lights depending on device.

BTW, how do I disable normal mapping so I can remove tbnMatrix varying vec? Basically, this is what I'm trying to set up for mobile version, and I noticed on some games this is the most common setup for mobile..

Diffuse
CombinedDiffuse/Lightmaps
Reflect

I hope this gets better and easier to configure on the source level where you can pick which texture or material shaders from the basic you would like to support for a project.

Offline RonTek

  • Sr. Member
  • ****
  • Posts: 311
Re: Vortex2 beta released - 3D module
« Reply #34 on: December 05, 2017, 11:54:43 PM »
Yay I finally got it working for low end mobile devices!!  :D :D :D

Diffuse ✓
Lightmaps ✓
Cubemaps ✓
Reflection ✓
Bone Animation ✓




Offline RonTek

  • Sr. Member
  • ****
  • Posts: 311
Re: Vortex2 beta released - 3D module
« Reply #35 on: December 05, 2017, 11:55:21 PM »
I see some great progress with Vortex2 and now a good alternative to MX MiniB3D!  :)

Offline RonTek

  • Sr. Member
  • ****
  • Posts: 311
Re: Vortex2 beta released - 3D module
« Reply #36 on: December 05, 2017, 11:55:46 PM »
..now moving into integrating it with existing 2D frameworks *bump* ouch  ;D

Offline JaviCervera

  • Jr. Member
  • **
  • Posts: 23
Re: Vortex2 beta released - 3D module
« Reply #37 on: December 06, 2017, 12:13:12 AM »
Great! Any changes apart from removing normal mapping?

Offline RonTek

  • Sr. Member
  • ****
  • Posts: 311
Re: Vortex2 beta released - 3D module
« Reply #38 on: December 06, 2017, 12:34:44 AM »
Great! Which changes did you have to do? Or was it the standard Git version? I made some more changes these past few days to make it work on iOS.

I'm still using the version with the Reflection and Refraction support with SLotman's fix since I only have to deal with the varying errors and found out that max lights should be around 3-4. I did check that for low end mobile devices, the supported was only 8, so I commented out depth, refract and parts where normal mapping is used (tbnMatrix?), at least for this specific renderer_shader version.

Yes, I am aware that there are a lot of changes since the fix and I would like to use the latest, but can't get anything to work on mobile, still looking forward to it :) :) :)


Offline RonTek

  • Sr. Member
  • ****
  • Posts: 311
Re: Vortex2 beta released - 3D module
« Reply #39 on: December 06, 2017, 12:38:27 AM »
Great! Any changes apart from removing normal mapping?

Yes, that was removing the varying for the fdepthCoords (for shadows?) and frefractCoords to make it work.

Offline JaviCervera

  • Jr. Member
  • **
  • Posts: 23
Re: Vortex2 beta released - 3D module
« Reply #40 on: December 06, 2017, 12:52:07 AM »
Sorry, I edited my previous question because I saw on the picture that the example didn't have normal mapping.

Nice, I think that the version that will be on beta2 will work. There will be several shaders, and the one with all the features used for the geometry that is about to be rendered will be used. If that one couldn't be compiled on startup, then features will be removed selectively until one does work.

The bottleneck on many mobile devices seem to be the 32 varying components available (components, not vars: a vec3 takes 3 components, a vec4 4, and so on). The TBN matrix takes 9 components, so I run out of space quickly. If I calculate the matrix on the fragment shader, I could save some and make it fit, but that would slow things a bit, so probably the best bet is to remove normal mapping entirely on these devices.

Offline RonTek

  • Sr. Member
  • ****
  • Posts: 311
Re: Vortex2 beta released - 3D module
« Reply #41 on: December 06, 2017, 01:16:20 AM »
Sorry, I edited my previous question because I saw on the picture that the example didn't have normal mapping.

Nice, I think that the version that will be on beta2 will work. There will be several shaders, and the one with all the features used for the geometry that is about to be rendered will be used. If that one couldn't be compiled on startup, then features will be removed selectively until one does work.

The bottleneck on many mobile devices seem to be the 32 varying components available (components, not vars: a vec3 takes 3 components, a vec4 4, and so on). The TBN matrix takes 9 components, so I run out of space quickly. If I calculate the matrix on the fragment shader, I could save some and make it fit, but that would slow things a bit, so probably the best bet is to remove normal mapping entirely on these devices.

Sounds awesome! :) As for normal mapping, yes I see most mobile games does not require it, but still good to have if you can replace one material with it, which seems to be in this case and it looks flexible.

As for textured shadows, any way to change the opacity and color? Maybe add PCF or blur options for desktop and web?

Offline JaviCervera

  • Jr. Member
  • **
  • Posts: 23
Re: Vortex2 beta released - 3D module
« Reply #42 on: December 06, 2017, 01:42:51 AM »
Shadows use the global ambient color which can be set with World.Ambient(color) (maybe in the version you are using it is still World.SetAmbient(color), I am making some changes to the API now that it is still in beta).

Shadows use mutiplicative mode, not alpha blending, so the way to change the opacity is to make the ambient color brighter.

PCF and blur are features I would like to work on (as well as multiple and cascaded shadows), but not before I release 2.0-stable.

Offline RonTek

  • Sr. Member
  • ****
  • Posts: 311
Re: Vortex2 beta released - 3D module
« Reply #43 on: December 06, 2017, 02:05:24 AM »
Shadows use the global ambient color which can be set with World.Ambient(color) (maybe in the version you are using it is still World.SetAmbient(color), I am making some changes to the API now that it is still in beta).

Shadows use mutiplicative mode, not alpha blending, so the way to change the opacity is to make the ambient color brighter.

PCF and blur are features I would like to work on (as well as multiple and cascaded shadows), but not before I release 2.0-stable.

Thanks! will try some shadow setup on desktop/web.  :)

BTW, here's a reference on what I'm using for testing low end devices. Galaxy Note 3, Android 4.x






Offline JaviCervera

  • Jr. Member
  • **
  • Posts: 23
Re: Vortex2 beta released - 3D module
« Reply #44 on: December 10, 2017, 11:34:41 PM »
Thank you! Knowing the limits on uniforms and varyings will be very useful.