Search found 646 matches

by grump
Tue Nov 24, 2020 1:09 pm
Forum: Support and Development
Topic: i have a error that not undersand , i need help
Replies: 4
Views: 320

Re: i have a error that not undersand , i need help

Manually calling love.load to restart a game requires very careful programming to make it go smooth. You're even calling it from love.update(), which is a good way to make sure weird things will happen if you're not super careful. It's not meant to used that way; love will call it once when the game...
by grump
Sat Nov 21, 2020 12:55 pm
Forum: Support and Development
Topic: drawInstanced and setDrawRange
Replies: 0
Views: 273

drawInstanced and setDrawRange

When having one mesh for the perinstance attributes of several other meshes that get drawn with drawInstanced, is it possible to set the start index of the vertex from which the attributes will be taken? I tried setDrawRange, but drawinstanced still starts reading the attached attributes from the fi...
by grump
Fri Oct 30, 2020 11:17 am
Forum: Support and Development
Topic: Creating and drawing polygons
Replies: 4
Views: 2232

Re: Creating and drawing polygons

It depends on how big and complex the polygons are, and the number of polygons and how many you need to draw per frame. If it's hundreds of large and unique polygons that need to be moved around independently, Canvas may use too much memory. Meshes are never the wrong choice, but the "varying line w...
by grump
Fri Oct 30, 2020 9:46 am
Forum: Support and Development
Topic: Creating and drawing polygons
Replies: 4
Views: 2232

Re: Creating and drawing polygons

For static polygons that aren't too big, drawing them once to a Canvas would be a good solution. Meshes are generally more efficient than immediate mode polygons, because they don't need to be rebuild every time. They are a little more complicated to build though. If you don't have a performance pro...
by grump
Wed Oct 28, 2020 9:24 pm
Forum: Support and Development
Topic: Reversing gamma correction to get accurate linear color values
Replies: 5
Views: 2108

Re: Reversing gamma correction to get accurate linear color values

Duh... yes, my bad. I did it wrong in the test code, but I'm already using a uniform in the actual code. Turns out the real reason why the wrong layers are selected is this bug . In the code where this happens, more processing is involved with multiple intermediate results and readbacks, and somewhe...
by grump
Wed Oct 28, 2020 4:26 pm
Forum: Support and Development
Topic: Reversing gamma correction to get accurate linear color values
Replies: 5
Views: 2108

Re: Reversing gamma correction to get accurate linear color values

The attachment with the gamma correct love file disappeared after the post was created. Here it is.
by grump
Wed Oct 28, 2020 4:14 pm
Forum: Support and Development
Topic: Reversing gamma correction to get accurate linear color values
Replies: 5
Views: 2108

Reversing gamma correction to get accurate linear color values

I want to use the color information in a Canvas of format 'r8' to select layers from an ArrayImage in a shader. This is working fine, unless gamma correction is enabled. Shader code: uniform ArrayImage arrayCanvas; vec4 effect(vec4 color, Image tex, vec2 uv, vec2 fc) { float layer = floor(Texel(tex,...
by grump
Wed Oct 28, 2020 3:10 pm
Forum: Support and Development
Topic: Using shader in Love2D
Replies: 5
Views: 2676

Re: Using shader in Love2D

5. then to pass in the iTime attribute something like; shader:send("millis", love.timer.getTime()) Due to precision errors after long uptime, passing the time like this can result in laggy animation. Get the timer value from love.timer.getTime() when the game starts, and subtract it from the curren...
by grump
Sat Oct 24, 2020 1:36 pm
Forum: Support and Development
Topic: Is DDS cross platform? (+ related question)
Replies: 2
Views: 1532

Re: Is DDS cross platform? (+ related question)

DXTn is widely supported on desktop machines. BCn seems to be the standard on mobile. As far as I know, there is no common denominator that works everywhere.
by grump
Sat Oct 24, 2020 1:14 pm
Forum: Support and Development
Topic: simple particle question
Replies: 7
Views: 2198

Re: simple particle question

love.graphics.newRectangle does not even exist. That "self-explanatory" error message explains to you that ParticleSystem can only emit Textures.

Draw the rectangle to a Canvas to use it as a texture.