Skip to content

[Question] Questions about preset authoring #917

@AntiSol

Description

@AntiSol

Please confirm the following points:

  • This question is NOT about the Android apps in the Play Store
  • I have searched the project page to check if the question was already asked elsewhere

Topic

General Request

Your Request

Hello,

I tried to join the discord to ask this, but it said "unable to accept invite", providing no other error message or information of any kind. Not sure what I can do about that 🤷:
yay discord

I have a few questions about preset authoring.

  1. Best source for info?

I've been reading the Preset Authoring guide on the wiki (and also the old original version), but there seems to be quite a bit of info which is referring to milkdrop rather than projectM. For instance the guide says that if I specify a that a shape should be textured with shapecode_x_textured but don't provide an ImageURL, then it should be textured with the previous frame, but this doesn't seem to work as advertised. I assume because projectM hasn't implemented that feature?

What is the best source of info WRT authoring presets specifically for projectM? Is there some better source than the wiki on github?

  1. Possible to maintain aspect ratio of textures?

I've been playing around with creating a projectM preset to draw an image, with code like:

shapecode_7_enabled=1
shapecode_7_sides=4
shapecode_7_textured=1
shapecode_7_ImageURL=my_image.tga
shapecode_7_x=0.5
shapecode_7_y=0.5
shapecode_7_rad=1.5
shapecode_7_tex_zoom=0.6
shapecode_7_r=1
shapecode_7_g=1
shapecode_7_b=1
shapecode_7_a=1
shapecode_7_r2=1
shapecode_7_g2=1
shapecode_7_b2=1
shapecode_7_a2=1

My image is square - 300x300. The problem I'm having is that when I run my preset in a widescreen resolution like 1280x720, the image is stretched. I have the 'aspect ratio correction' option enabled. If I remove the ImageURL from the shape, it shows up as a square, even at 1280x720. It looks like the texture is being stretched (but not resized?) to match the window resolution?

  1. Can custom shapes be arbitrarily defined / textured?

I see I can define regular polygons by setting the number of sides, which gives me evenly-sided shapes. What I'd like though is to have a shape where I define the x/y coordinates of each point. In particular I'd like to have a trapezoid or parallelogram, like so:

Image

I'd also like to be able to have my texture image deformed to this shape, i.e this would allow me to make it look like my image has perspective, and to shift that "perspective" over time.

I can achieve something similar to what I want to do by applying a perspective transform to the image before I save it, setting up multiple shapes for the different perspectives I want, and toggling their 'enabled' state in a per_frame statement, but this doesn't allow for smooth transforms. e.g I have 'left' and 'right' perspectives which i can switch between, but there's no way to have it smoothly transform from one to the other, which is what I'd like.

texture_left.tga:

Image

texture_right.tga:

Image
per_frame_1=q30=sin(time * 2);

shapecode_1_enabled=0
shapecode_1_sides=4
shapecode_1_textured=1
shapecode_1_ImageURL=texture_left.tga
shapecode_1_x=0.5
shapecode_1_y=0.5
shapecode_1_rad=1.5
shapecode_1_tex_zoom=0.6
shapecode_1_r=1
shapecode_1_g=1
shapecode_1_b=1
shapecode_1_a=1
shapecode_1_r2=1
shapecode_1_g2=1
shapecode_1_b2=1
shapecode_1_a2=1
shape_1_per_frame6=enabled=if(above(q30,0),1,0); // visible when q30 > 0

shapecode_1_enabled=0
shapecode_1_sides=4
shapecode_1_textured=1
shapecode_1_ImageURL=texture_right.tga
shapecode_1_x=0.5
shapecode_1_y=0.5
shapecode_1_rad=1.5
shapecode_1_tex_zoom=0.6
shapecode_1_r=1
shapecode_1_g=1
shapecode_1_b=1
shapecode_1_a=1
shapecode_1_r2=1
shapecode_1_g2=1
shapecode_1_b2=1
shapecode_1_a2=1
shape_1_per_frame6=enabled=if(above(q30,0),0,1); // visible when q30 < 0

but it would be much better if I could supply 4 x/y coordinates to define the corners of my shape, and have my texture stretched to fit that shape. That way I could have just one texture file and smoothly move from "left" to "right". Is there any way to accomplish what I want?

I have about a thousand other questions, but those are the most pressing for now 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    presetsIssues regarding presets, or the curated preset collections shipped with projectM.questionThis issue is a general question about projectM and the surrounding ecosystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions