Giter Site home page Giter Site logo

Comments (5)

HikariIsChillin avatar HikariIsChillin commented on June 8, 2024

Same frame rendered in 0.25x, 0.5x, 1.0x and 2.0x scale:
004639_0 25x
004639_0 5x
004639_1 0x
004639_2 0x

from motion-canvas.

aarthificial avatar aarthificial commented on June 8, 2024

Can you take a look at #1026 to see if it fixes the issue completly?

from motion-canvas.

HikariIsChillin avatar HikariIsChillin commented on June 8, 2024

From my tests it fixed everything except inside of cached nodes.

If you use the same shader as before but like this it will still have the issue, the destinationUV is resized to the size of the cached node, but when you change the scale is stays at the size the node had before scaling.

import { Node, Rect, makeScene2D } from '@motion-canvas/2d'

import destinationUVbug from '../shaders/destinationUVbug.glsl'

export default makeScene2D(function* (view) {
	// view.shaders(destinationUVbug)

	view.add(
		<Node cache>
			<Rect size={view.size().sub(200)} shaders={destinationUVbug} />
		</Node>
	)
})

One funny interaction I noticed is that if you set the size of the rect with numbers or by subtracting from the view.size() like in the code above, the shader destinationUV will fit the Node properly at the normal scale, but if you do:

<Node cache>
	<Rect size={view.size().mul(0.5)} shaders={destinationUVbug} />
</Node>

Multiplying or dividing, the scale is broken just like when changing the scale of the scene. But this only happens if the scale of the scene isn't 1,0x. So my guess is both of these are the same issue.

from motion-canvas.

aarthificial avatar aarthificial commented on June 8, 2024

@HikariIsChillin Thanks for checking this out!
I added a fixup to #1026 now everything should work

from motion-canvas.

HikariIsChillin avatar HikariIsChillin commented on June 8, 2024

@aarthificial Everything is working now

from motion-canvas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.