{"action":"created","issue":{"url":"https://api.github.com/repos/SFTtech/openage/issues/1022","repository_url":"https://api.github.com/repos/SFTtech/openage","labels_url":"https://api.github.com/repos/SFTtech/openage/issues/1022/labels{/name}","comments_url":"https://api.github.com/repos/SFTtech/openage/issues/1022/comments","events_url":"https://api.github.com/repos/SFTtech/openage/issues/1022/events","html_url":"https://github.com/SFTtech/openage/pull/1022","id":324208011,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg4ODc3OTc4","number":1022,"title":"This is the new WIP renderer","user":{"login":"surajhanchinal","id":24355190,"node_id":"MDQ6VXNlcjI0MzU1MTkw","avatar_url":"https://avatars1.githubusercontent.com/u/24355190?v=4","gravatar_id":"","url":"https://api.github.com/users/surajhanchinal","html_url":"https://github.com/surajhanchinal","followers_url":"https://api.github.com/users/surajhanchinal/followers","following_url":"https://api.github.com/users/surajhanchinal/following{/other_user}","gists_url":"https://api.github.com/users/surajhanchinal/gists{/gist_id}","starred_url":"https://api.github.com/users/surajhanchinal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/surajhanchinal/subscriptions","organizations_url":"https://api.github.com/users/surajhanchinal/orgs","repos_url":"https://api.github.com/users/surajhanchinal/repos","events_url":"https://api.github.com/users/surajhanchinal/events{/privacy}","received_events_url":"https://api.github.com/users/surajhanchinal/received_events","type":"User","site_admin":false},"labels":[{"id":811272180,"node_id":"MDU6TGFiZWw4MTEyNzIxODA=","url":"https://api.github.com/repos/SFTtech/openage/labels/big%20stuff","name":"big stuff","color":"7fddf3","default":false},{"id":142245448,"node_id":"MDU6TGFiZWwxNDIyNDU0NDg=","url":"https://api.github.com/repos/SFTtech/openage/labels/c++","name":"c++","color":"000000","default":false},{"id":142055971,"node_id":"MDU6TGFiZWwxNDIwNTU5NzE=","url":"https://api.github.com/repos/SFTtech/openage/labels/rendering","name":"rendering","color":"1d76db","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-17T22:28:07Z","updated_at":"2018-06-08T21:43:26Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/SFTtech/openage/pulls/1022","html_url":"https://github.com/SFTtech/openage/pull/1022","diff_url":"https://github.com/SFTtech/openage/pull/1022.diff","patch_url":"https://github.com/SFTtech/openage/pull/1022.patch"},"body":"This is the new renderer I have been working on which is meant to be independent from the game state system and is more efficient than the current renderer. This is based on Vtec234's new-renderer branch which provided the OpenGL framework for this renderer. The build instructions are the same as the main game but there might be a Eigen3 dependency. That can be easily resolved by\r\n```\r\nsudo apt-get install libeigen3-dev\r\n```\r\nthe code currently resides as a demo in and can be run by\r\n```\r\n./run  test -d renderer.batch_test.batch_demo 0\r\n```\r\nThe main code that is being executed is in `/libopenage/renderer/batch_test.cpp`. You can go ahead and change what you want to display on the screen in there. So the basic unit for displaying anything on the screen is the `opengl::Sprite_2` class.\r\n\r\nHere is a brief documentation on how to use this \r\nSo you create an object with the constructor. It takes x,y,w,h,r,g,b,a in that order as arguments where x and y are positions and w and h are the width and height.  r,g,b,a are the colors . This renders a square with the given parameters on the screen. Then there are 2 helper functions for the `Sprite_2.set_texture(int id, bool metafile)`. The id is chooses the texture to be used. The ids are decided by the number of the textures in the `assets/converted/graphics` folder. For example, an elephant moving texture has an id 805 since its filename is `805.slp.png`. The second argument is basically choosing if you want to use texture description file which contains subtexture coordinates.\r\n\r\nThe next function is `set_subtex(int)` which chooses the subtexture from the texture and this function just takes the index of the subtexture as input.\r\n\r\nOnce the sprite is created, it needs to be submitted to the renderer in order for it to be shown on the screen. this is done by the `renderer->submit()` function which takes in the sprite as an argument. The submit must be placed between `renderer->begin()` and `renderer->end()` and before `renderer->render()`.\r\n\r\nThere are various commented parts of the code and you can uncomment them and run and experiment.\r\n\r\nPlease test this renderer and report the performance you are getting and any suggestions. The frame rate can be seen in the terminal that you run the command. :)\r\n\r\nEdit:\r\nYou can also render terrain but I've coded the renderer to use aoe2hd textures. If you do have the game, then copy the `terrain` folder from the game installation and place it in `/assets/` folder. And then for convinience and for indexing please rename the textures in `/assets/terrain/textures` from `1.png` to whatever `x.png` that you might want to use. Now to access these textures you would use another helper function of `opengl::Sprite_2` named `set_terrain(int)`. If you want to use `x.png`, you set the argument of the function `set_terrain()` as `6000+x`. I agree it's a little hackish but since the game asset system is being rewritten I did not want to integrate with the old asset manager, hence this problem.\r\n"},"comment":{"url":"https://api.github.com/repos/SFTtech/openage/issues/comments/395899277","html_url":"https://github.com/SFTtech/openage/pull/1022#issuecomment-395899277","issue_url":"https://api.github.com/repos/SFTtech/openage/issues/1022","id":395899277,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTg5OTI3Nw==","user":{"login":"TheJJ","id":673543,"node_id":"MDQ6VXNlcjY3MzU0Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/673543?v=4","gravatar_id":"","url":"https://api.github.com/users/TheJJ","html_url":"https://github.com/TheJJ","followers_url":"https://api.github.com/users/TheJJ/followers","following_url":"https://api.github.com/users/TheJJ/following{/other_user}","gists_url":"https://api.github.com/users/TheJJ/gists{/gist_id}","starred_url":"https://api.github.com/users/TheJJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheJJ/subscriptions","organizations_url":"https://api.github.com/users/TheJJ/orgs","repos_url":"https://api.github.com/users/TheJJ/repos","events_url":"https://api.github.com/users/TheJJ/events{/privacy}","received_events_url":"https://api.github.com/users/TheJJ/received_events","type":"User","site_admin":false},"created_at":"2018-06-08T21:43:26Z","updated_at":"2018-06-08T21:43:26Z","author_association":"MEMBER","body":"I fear this branch is quite messed up, your `first commit` seems to commit the whole repo state again and thus is very large (>20MB)."}}
{"actor":{"display_login":"TheJJ"}}