PDA

View Full Version : Replacement of evaluators in OpenGL3.3 and above



mobeen
01-27-2011, 01:18 AM
Hi all,
Since evaluators have been deprecated (removed in the core profile), I want to know what alternates do i have?
From my preliminary search (using google and this forum), it seems I would have to roll my own patch/surface renderer. If this is the case, are there any available resources online that might help me with this preferrably in opengl 3.3 or above?

I have a set of points representing the surface but all of the opengl code (for rendering them as patches) that I have found online uses evaluators.

Kindest regards,
Mobeen

ugluk
01-27-2011, 06:06 AM
If I was really hard pressed for an evaluator, I'd go over to Mesa3D site and take a look at some of its code.

mobeen
01-27-2011, 06:08 AM
If I was really hard pressed for an evaluator, I'd go over to Mesa3D site and take a look at some of its code.
Thanks for the reply Ugluk. Ok is there any other thing instead of evaluators that I may use?

Jan
01-27-2011, 12:42 PM
I never bothered to really look at evaluators, but weren't they supposed to do similar stuff, that tesselation does now? Only more hardwired? If so, searching for resources about tesselation might give you some input.

Jan.

mobeen
01-27-2011, 08:13 PM
I never bothered to really look at evaluators, but weren't they supposed to do similar stuff, that tesselation does now? Only more hardwired? If so, searching for resources about tesselation might give you some input.

Jan.
But I cant use tesselation shaders my card does not support them.

Alfonse Reinheart
01-27-2011, 10:30 PM
But I cant use tesselation shaders my card does not support them.

The compatibility profile exists for a reason. If you want to use the old evaluators, there's nothing stopping you.

mobeen
01-27-2011, 11:59 PM
But I cant use tesselation shaders my card does not support them.

The compatibility profile exists for a reason. If you want to use the old evaluators, there's nothing stopping you.
Thanks Alfonse. But i was asking if i want to stick with the core profile and want to do what evaluators are doing, how would i do it. In other words what is the alternate of evaluators in the modern OpnGL (core profile). Tesselation shader seems to be one answer is there any other alternate.

Alfonse Reinheart
01-28-2011, 01:35 AM
One of the reasons for the removal of functionality from OpenGL was to keep OpenGL focused on functionality that reflected what the hardware was capable of. The old evaluators were never implemented in hardware, so they were removed. There was no replacement for them until 4.x because there was no hardware to replace them until 4.x/Direct3D11-class hardware came out.

Thus, if you need evaluators, you have two options. Write them yourself, or use the compatibility profile. And if you write it yourself, how you do so depends mostly on your needs. Do you need the feature to be exactly what the old evaluators provided, or do you only need a focused subset? Since you're writing it yourself, you can give it any API you want.

mobeen
01-28-2011, 01:52 AM
Hmm ok I dont think i need a focused subset to handle a simple cloth. Guess i will write my own.

Thanks for the input though.

Regrds,
Mobeen

Jan
01-28-2011, 02:06 AM
I didn't mean that you need to use tesselation shaders, I only meant that searching for tesselation should give you ideas how to do the math (in the end it's usually some kind of beziér curve etc.)

Jan.

mobeen
01-28-2011, 02:41 AM
I didn't mean that you need to use tesselation shaders, I only meant that searching for tesselation should give you ideas how to do the math (in the end it's usually some kind of beziér curve etc.)

Jan.
Oh ok thanks for that yeah i was thinking of maybe using geometry shaders to do basic bezier surface but i am not sure how it will behave performance wise any ideas if i use geometry shaders to generate surface would it have significant impact on performance?

Alfonse Reinheart
01-28-2011, 02:45 AM
Pretty much every guide about using geometry shaders tells you not to use them for general tessellation. At least not with GL 3.x class hardware.

mobeen
01-28-2011, 03:14 AM
Pretty much every guide about using geometry shaders tells you not to use them for general tessellation. At least not with GL 3.x class hardware.
Hmm so now what other option do i have? I want to use the core profile so I cannot use evaluators. And as you say it is going to hit perfromance if i use geometry shaders esp. on the opnGL 3.x class hardware that i have. I guess I would have to stick with custom tesselation and glBufferSubData to update new vertices on the vertex buffer object.

Jan
01-28-2011, 04:19 AM
Well, you do have several options.
* You could do it all manually on the CPU.
* You could do it with geometry shaders.
* You could always upload a very high-res mesh with some additional data at the vertices and then do the rest just in the vertex-shader.
* You could upgrade to DX11 class hardware and do it with tesselation.

Geometry shaders are not really fast, if you output lots of new triangles, but doing just a bit of subdivision is doable. So you could use a higher-resolution base-mesh and just add the final touches in the GS and it should be fast enough.

I would start with the option that you can get to work the easiest. Possibly a pure CPU implementation. Once you got it working you can try out different methods and see how fast they are. Also just using a very high-res mesh and doing all the work in the VS might be a good idea to just get it working and to check out the performance base-line, so that you have some numbers to compare the rest with.

In the future you would probably migrate it to use tesselation, so keeping an eye out for how that works is always a good idea. On the other hand, if this is just a small pet project to fiddle around with some idea, it really doesn't matter how exactly you implement it now, it's the experience you gain, that has the most value.

Jan.

mobeen
01-28-2011, 04:25 AM
Wonderful reply Jan.