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

Apply shaders on composite objects #94

Merged
merged 4 commits into from
May 6, 2016
Merged

Conversation

emaxe
Copy link
Contributor

@emaxe emaxe commented Apr 18, 2016

  • added the ShaderComponent support;

- added the ShaderComponent support;
@azakhary
Copy link
Contributor

This part is a bit harder. You see we already have this kind of code for Images only (if you look at TextureRegionDrawLogic it has this shader condition there) so if you put shader on image with this code, you will get shader applied twice. I think your solution is good, if you also remove the shader part from the place I mentioned. Also make sure to pass as uniform some variables like time, delta time for shader animtions.

Does this make sense?

@emaxe
Copy link
Contributor Author

emaxe commented Apr 18, 2016

Well, yes , I tested only with composite objects. I need to get the items from the library , and then add to the engine. Then apply a shader . In the library I can put only a composite object, so my solution I like more ..
And the uniforms can pass from any place of code.. For example, from main cycle in ApplicationAdapter

@azakhary
Copy link
Contributor

yes, so because your code works for any item (including images) the shader code for images should be removed to not interfere with this one. Would be nice if you can do this for further testing.

emaxe added 2 commits April 18, 2016 16:17
- remove shader apply from TextureRegionComponent
- remove shader from TextureRegionComponent
@emaxe
Copy link
Contributor Author

emaxe commented Apr 18, 2016

You know , my first solution works well with all objects and do not have a collision. In Overlap2dRenderer in drawRecursively function we do not have an simple image, only composite objects.

@emaxe emaxe changed the title Update Overlap2dRenderer.java Apply shaders on composite objects Apr 18, 2016
@azakhary
Copy link
Contributor

hmm. oh I see what you mean. let me check that. it should be correct then.
Btw have you tested? Also one more note someone who adds shader to a composite, should be aware that this shader without use of FBO, will be performing badly of many objects overlap. Should be used carefully.

@emaxe
Copy link
Contributor Author

emaxe commented Apr 18, 2016

Yes, i test it with composite objects and simple images.
And, of course , in the composite object shader apply to each texture separately .

@azakhary
Copy link
Contributor

azakhary commented May 6, 2016

Tested and confirmed, thanks! Merging now.

@azakhary azakhary merged commit 91edb27 into UnderwaterApps:master May 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants