Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Material refactor #1432

Merged
merged 81 commits into from Sep 3, 2012
Merged

Material refactor #1432

merged 81 commits into from Sep 3, 2012

Conversation

Luomu
Copy link
Member

@Luomu Luomu commented Aug 13, 2012

The half-unfinished use of materials and shaders has now gone through some big changes.

All Materials need to be now requested from a Renderer by filling out a MaterialDescriptor structure and then calling CreateMaterial. Renderer then returns a new Material that best matches the descriptor. Users are required to delete the materials themselves, it is not useful to cache these in renderer since they are not shareable.

For renderer internals, this means less if-else during draw, instead each material's Apply() sets up the required state and Unapply() cleans it. Only renderers are supposed to call Apply, I made an exception for GeoSphere because it does not use renderer for rendering yet. LMR also has a "special" solution applied to it.

The old Shader class has been replaced by GL2::Program and is obviously not supposed to be used outside the GL2 renderer. Programs are managed by the renderer and shared between materials.

kko added 30 commits August 4, 2012 12:23
Updated .obj location to have paths, VS fails if two .cpps share the same name.
@Luomu
Copy link
Member Author

Luomu commented Aug 19, 2012

I think you can now consider this for merge.

@Luomu
Copy link
Member Author

Luomu commented Sep 1, 2012

Updated to master and updated VS2010 project, nothing special

@robn
Copy link
Member

robn commented Sep 1, 2012

Thanks. I started reviewing this last night. Got about half way through before I fell asleep - unrelated, I promise! So far there's a couple of little quirks need to think about, but mostly its awesome - tons of horror code removed, lots of nice code added! I'll finish it off tonight.

@Luomu
Copy link
Member Author

Luomu commented Sep 2, 2012

Fixed a line drawing depth bug.

Drink some coffee to avoid falling asleep!

@robn robn merged commit 8bc5b05 into pioneerspacesim:master Sep 3, 2012
@robn
Copy link
Member

robn commented Sep 3, 2012

Code seems fine. I have a few comments to add, but nothing that would stop it being merged. I'll write them down tonight if I get my computer up and running in time (new disk to install).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants