Vortex2 beta released - 3D module

Started by JaviCervera, August 31, 2017, 14:03:24

Previous topic - Next topic

JaviCervera

#30
Quote from: RonTek on December 04, 2017, 22:05:02
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.

RonTek

#31
Quote from: JaviCervera on December 05, 2017, 09:21:40
Quote from: RonTek on December 04, 2017, 22:05:02
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:

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..

JaviCervera

#32
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).

RonTek

#33
Quote from: JaviCervera on December 05, 2017, 13:16:00
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.

RonTek

#34
Yay I finally got it working for low end mobile devices!!  :D :D :D

Diffuse ✓
Lightmaps ✓
Cubemaps ✓
Reflection ✓
Bone Animation ✓




RonTek

#35
I see some great progress with Vortex2 and now a good alternative to MX MiniB3D!  :)

RonTek

#36
..now moving into integrating it with existing 2D frameworks *bump* ouch  ;D

JaviCervera

#37
Great! Any changes apart from removing normal mapping?

RonTek

#38
Quote from: JaviCervera on December 06, 2017, 00:13:12
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 :) :) :)


RonTek

#39
Quote from: JaviCervera on December 06, 2017, 00:13:12
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.

JaviCervera

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.

RonTek

#41
Quote from: JaviCervera on December 06, 2017, 00:52:07
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?

JaviCervera

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.

RonTek

#43
Quote from: JaviCervera on December 06, 2017, 01:42:51
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






JaviCervera

#44
Thank you! Knowing the limits on uniforms and varyings will be very useful.