- Home /
Hex grid effects
I am currently working on a hex based strategy game and I want to improve the hex system I have currently implemented but there are some things I do not currently know how to achieve yet, some guidance about my approach would be appreciated.
Currently my hex system clones a model for each hex on a grid visible by the camera and colors the material of each model appropriately based on the game logic. This is what it looks like at the moment:
What I want to be able to do is to add effects to continuous segments of the hex grid. For instance I want to have the group of blue hexes have a glowing outline. I realized that I would firstly need to redesign how the hex models work. My first step is to define continuous segments of the grid as a single model which is created programatically. In the example above I would have 5 segments (3 blue, 2 grey). I hope to also increase performance by doing this as it seems like my render thread is taking 2.6ms as opposed to 0.7ms when not rendering hexes.
The bit I am stuck on is how to apply a glow effect to the models. I want this glow effect to be displayed on the screen over any entity models/terrain that may be covering the hex grid. In my mind the following set of steps could achieve it.
1) Copy and scale hex model slightly larger across the hex grid plane using vertex shader, fragment shader will color this white. Copy this white render to a texture.
2) Make a black copy of the hex model and render this to another texture.
3) Write a full screen effect that blurs the texture outputted in 1 and masks the pixels using the black parts of the texture created in 2.
4) Apply color tint.
5) Compose final textures onto the hex grid in the game view.
I am not experienced at all with writing shaders but I think I can learn it, the issue I am facing is how to actually set this all up.
Can you limit visibility of models to certain cameras? Do I need multiple cameras, one for each render to texture needed? Is the above approach the best way or even doable?
This is an example I put together in photoshop of what I want to achieve.
Your answer
Follow this Question
Related Questions
Old TV Set post effect 2 Answers
How to make a nice shockwave ? 1 Answer
Creating this light effect 1 Answer
3D Texture and normals 0 Answers