Search found 641 matches

by grump
Wed Oct 28, 2020 4:26 pm
Forum: Support and Development
Topic: Reversing gamma correction to get accurate linear color values
Replies: 1
Views: 9

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: 1
Views: 9

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: 4
Views: 148

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: 122

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: 191

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.
by grump
Thu Oct 22, 2020 1:43 pm
Forum: General
Topic: Love CPU usage
Replies: 39
Views: 18475

Re: Love CPU usage

5000 distinct images per frame is not only an unrealistic scenario, it is also the worst possible way to render graphics. Switching textures is expensive, and it breaks batching. Better performance can be achieved by using sprite atlases (many images in one single texture), and Quad s to render them...
by grump
Wed Oct 21, 2020 10:54 am
Forum: Support and Development
Topic: Using shader in Love2D
Replies: 4
Views: 148

Re: Using shader in Love2D

See the "Shader language" part of love.graphics.newShader for basic differences. The variables provided by the Shadertoy runtime (buffers, time, etc.) should be documented on their site somewhere - you have to implement most of those yourself in LÖVE.
by grump
Mon Oct 12, 2020 10:05 pm
Forum: Support and Development
Topic: Created .exe, when running .exe error unable to load audio file
Replies: 26
Views: 1792

Re: Created .exe, when running .exe error unable to load audio file

I would be concerned with using LÖVE's systems/API at any point before love.load() is called. Later than that should be fine (after all systems were initialized). AFAIK, love.load has no technical relevance. Anything you can do in in love.load, you can do at the top level of main.lua. The error her...
by grump
Mon Sep 28, 2020 12:18 pm
Forum: Support and Development
Topic: Love2D and HTML5 games
Replies: 8
Views: 894

Re: Love2D and HTML5 games

ivan wrote:
Mon Sep 28, 2020 6:46 am
https://2dengine.com/superchains/
That's not working for me in Firefox 81.0

Code: Select all

Uncaught ReferenceError: SharedArrayBuffer is not defined
    Love https://2dengine.com/superchains/love.js:9
    applicationLoad https://2dengine.com/superchains/:35
    onload https://2dengine.com/superchains/:1
by grump
Mon Sep 28, 2020 12:14 pm
Forum: Support and Development
Topic: Documentation lists multiple versions of the same function
Replies: 2
Views: 488

Re: Documentation lists multiple versions of the same function

There is only one function, but what that function does depends on the number and the types of the call arguments. love.graphics.newFont('myfont.ttf') -- create font with default size and options love.graphics.newFont('myfont.ttf', 32) -- create font at size 32 with default options love.graphics.new...