Re: [warzone2100-dev] OpenGL ES (2.0)

2010-09-14 Thread Giel van Schijndel
On Tue, Sep 14, 2010 at 12:30:48 -0400, buginator wrote:
> On 9/13/10, Giel van Schijndel  wrote:
>>  This however, would require significant changes to the drawing code.
>>  Keep in mind that these changes would be required for *pure* OpenGL 3.0
>>  as well, with "pure" meaning without the backward compatibility
>>  extensions.  The two most significant changes are:
>>   * immediate-mode drawing would have to go (glBegin()/glEnd()),
>>replacing it with either VAs or VBOs
> 
> I am fine with this.
> 
>>   - in OpenGL ES the matrix stacks don't exist anymore, so we would have
>> to maintain this stack outside of the OpenGL API (relatively easy to
>> do)
> 
> This is also needed for proper support of LoD, occlusion culling, and
> some other things.  I am also fine with this.
> 
>>   - fixed pipeline rendering is mostly gone, so a shader performing the
>> vertex transformation (multiplication with model-view and projection
>> matrices) would have to be used.
> 
> The only real concern I have is driver support, on all the platforms
> we support.

Right, this is largely due to the complete removal of all matrix-related
functions from the API.  The only API function still handling matrices is
glUniform.

Thus the only way of getting matrix multiplication in OpenGL ES 2.0 is
by means of reimplementing that part of the fixed function pipeline in
GLSL.  If done properly this shader probably wouldn't be required on
systems that still have the fixed function pipeline.

>>  Please give me your thoughts on making these changes.  Personally I
>>  don't think removing of immediate-mode rendering is a very big deal, nor
>>  is replacing gl(Push|Pop)Matrix with our own implementation.  Completely
>>  shedding our dependence on the fixed rendering pipeline is something
>>  of an entirely different scale though.
> 
> A rewrite of the gfx engine is need, since most of it is still done
> with the brute force approach.  Getting rid of the fixed pipeline was
> on my long term TODO list anyway. :)
> 
> Would this be done directly in trunk, or would a new branch be made for this ?
> Since I see you started working on the 'easier' stuff, did you have a
> timeframe when all this would be done ?

Definitely trunk since I expect that most (hopefully all) changes can be
done incrementally, and thus without disturbing trunk too much.  As for
a time frame, I haven't thought about that yet, my intention was just to
"code till completion".

PS OpenGL ES 1.1 *does* support the fixed function pipeline but has no
   support for the programmable pipeline, so is IMO not a good option at
   all.

-- 
Giel
--
"There are 2 hard problems in computer science: cache invalidation,
 naming things, and off-by-1 errors."
  -- Leon Bambrick


signature.asc
Description: Digital signature
___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [warzone2100-dev] OpenGL ES (2.0)

2010-09-13 Thread buginator
On 9/13/10, Giel van Schijndel  wrote:
>  This however, would require significant changes to the drawing code.
>  Keep in mind that these changes would be required for *pure* OpenGL 3.0
>  as well, with "pure" meaning without the backward compatibility
>  extensions.  The two most significant changes are:
>   * immediate-mode drawing would have to go (glBegin()/glEnd()),
>replacing it with either VAs or VBOs

I am fine with this.

>   - in OpenGL ES the matrix stacks don't exist anymore, so we would have
> to maintain this stack outside of the OpenGL API (relatively easy to
> do)

This is also needed for proper support of LoD, occlusion culling, and
some other things.  I am also fine with this.

>   - fixed pipeline rendering is mostly gone, so a shader performing the
> vertex transformation (multiplication with model-view and projection
> matrices) would have to be used.

The only real concern I have is driver support, on all the platforms we support.

>  Please give me your thoughts on making these changes.  Personally I
>  don't think removing of immediate-mode rendering is a very big deal, nor
>  is replacing gl(Push|Pop)Matrix with our own implementation.  Completely
>  shedding our dependence on the fixed rendering pipeline is something
>  of an entirely different scale though.

A rewrite of the gfx engine is need, since most of it is still done
with the brute force approach.  Getting rid of the fixed pipeline was
on my long term TODO list anyway. :)

Would this be done directly in trunk, or would a new branch be made for this ?
Since I see you started working on the 'easier' stuff, did you have a
timeframe when all this would be done ?

___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [warzone2100-dev] OpenGL ES (2.0)

2010-09-13 Thread Giel van Schijndel
On Mon, Sep 13, 2010 at 13:17:09 +0200, Giel van Schijndel wrote:
> I've been looking into modifying the rendering code in such a way that
> it can be used to render on OpenGL ES (ES 2.0+ considering that I only
> have hardware to test that version) enabled devices.
> 
> This however, would require significant changes to the drawing code.
> Keep in mind that these changes would be required for *pure* OpenGL 3.0
> as well, with "pure" meaning without the backward compatibility
> extensions.  The two most significant changes are:
>  * immediate-mode drawing would have to go (glBegin()/glEnd()),
>replacing it with either VAs or VBOs
>   - which code-wise, are nearly the same thing, VBOs are just VAs cached
> in video memory.

I already have a patch available [1] to remove (almost) all cases of
immediate-mode rendering.  Only one remains that is either implemented
buggy or depends on some obscure way that vertex attributes are
aggregated.

[1] http://developer.warzone2100.org/ticket/2172


-- 
Giel
--
"A clever person solves a problem. A wise person avoids it."
  -- Albert Einstein


signature.asc
Description: Digital signature
___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev