Skip to main content
18 events
when toggle format what by license comment
Feb 18, 2020 at 19:21 vote accept stusmith
Feb 18, 2020 at 19:21 answer added stusmith timeline score: 0
Feb 8, 2020 at 9:46 comment added stusmith I will give the shader approach a go, thanks! Might be a week or two before I get a day off to try it however...
Feb 7, 2020 at 23:55 review Close votes
Feb 22, 2020 at 3:05
Feb 7, 2020 at 23:35 comment added Bálint Does this answer your question? How to write properly shader with gradient based on vertex-color?
Feb 7, 2020 at 18:14 comment added DMGregory Again, do not use a link to an external site. Embed the relevant code in the question itself.
Feb 7, 2020 at 17:50 comment added stusmith Apologies, I have put a better link to my actual branch changes in the question.
Feb 7, 2020 at 17:43 history edited stusmith CC BY-SA 4.0
added 151 characters in body
Feb 7, 2020 at 17:39 comment added DMGregory Great, include that code in your question, not in an external link buried in the comments.
Feb 7, 2020 at 17:07 comment added stusmith I'm applying it here: github.com/liballeg/allegro5/blob/master/src/win/… specifying four different tint values.
Feb 7, 2020 at 16:21 comment added DMGregory You may want to show us how you are applying this tint. Depending on where it's being injected into the shading logic, there may be opportunities to control the interpolation to have a different look.
Feb 7, 2020 at 16:18 comment added Tom Tsagkatos I'm not saying you did something wrong, I'm saying the results you expect will not happen with this method. This has nothing to do with shapes being rendered as triangles or rectangles. You've painted one corner with a colour, and Allegro correctly interpolates that to the rest of the rectangle. Are you trying to do a "Fog of War" effect?
Feb 7, 2020 at 16:15 comment added stusmith I have found this: gamedev.stackexchange.com/questions/126078/… ... which is a completely different approach. I may have to go down that route if there is no solution to the way I've tried things.
Feb 7, 2020 at 16:15 comment added stusmith I think I've got things correct, and I've updated the question with some examples of lighting being overridden.
Feb 7, 2020 at 16:14 history edited stusmith CC BY-SA 4.0
Examples
Feb 7, 2020 at 16:05 comment added Tom Tsagkatos To me it looks like you've changed the colour of only one corner, and it renders as it should. Have you changed the tint on multiple corners? If there is a rectangle with 3 black corners, and one white, the pixels in the middle will be mostly black, because they are affected by 3 corners, versus the 1 white. You can observe a similar result if you open a 3D modeling software, create rectangle and apply 3 black corners and 1 white using vertex colours. This is not the result of the bitmap being rendered as 2 triangles, you can confirm that by painting 2 corners instead of only 1.
Feb 7, 2020 at 16:05 review First posts
Feb 20, 2020 at 20:55
Feb 7, 2020 at 16:01 history asked stusmith CC BY-SA 4.0