Meta-Ben / Previewer_2D_3D

Godot Plugin : allow you to preview 2D and 3D during edition of the other
MIT License
23 stars 4 forks source link

preview is low resolution #1

Open leon196 opened 2 months ago

leon196 commented 2 months ago

Hello,

Thanks for the add-on, this is very useful. It appears that the preview is not at full resolution, this is a screenshot of project with Godot 4.3:

image

I'm looking at trying to fix it but I'm still learning how to use Godot and custom add-ons, so I'm wondering if you know how to resolve it?

Meta-Ben commented 2 months ago

Hello ! Just saw your comment, I will try to reproduce the problem !

Meta-Ben commented 2 months ago

@leon196 After some test I didn't succeed to reproduce your bug

I first tried with a big image as Sprite2D :

Capture d’écran 2024-09-24 à 14 30 20

Then I tried scaling this image to 1000 to see if your problem is caused by a too big image for the previewer but still I can see it fully and clearly :

Capture d’écran 2024-09-24 à 14 32 59

Maybe you can help me with some additional info :

Also when you say " the preview is not at full resolution" did you mean that your image in the preview is cropped ?

Those inputs could help me too fix your issue :)

leon196 commented 2 months ago

Thanks for the quick reply and taking the time to test.

Here's a video, it's hard to see quite right the actual resolution because of the compression: https://github.com/user-attachments/assets/70a1b3a8-7ec7-4e91-8edf-d4d512919c6b

Now that I've tried with a sprite2D, I think the plugin works as it should. It's how the minification of the texture works.

This is a screenshot of the default 2D view. image

And with the previewer. image

Since it's hard to tell, here the two close up of the views. image image

My goal is to pin the 2D view, to keep track of the comic layout, so I can update camera placement, while having a global view of the layout. I'll try to interact with the plugin source code a little more and keep you posted if I get something interesting.

Meta-Ben commented 2 months ago

Thanks for the huge input you gave me, It's really help me a lot to understand the problem you face ! I will take a look and try to fix this but it could take me some time, if the sprite2D method work go with it for now if you can

Meta-Ben commented 2 months ago

@leon196 I tried to setup my project the same as yours, but even in that I didn't succeed to reproduce your problem, here is my 2D preview quality using subview and control texture node :

Capture d’écran 2024-09-29 à 16 15 48

And here is the actual 2D control texture node quality in the 2D editor :

Capture d’écran 2024-09-29 à 16 16 26

Look like there is no difference for me, maybe try using the "nearest" option in your SubViewPortContainer ( the green one )

Capture d’écran 2024-09-29 à 16 19 02
leon196 commented 2 months ago

Interesting, thanks for exploring the issue. Setting nearest filter will change the rendering of the viewport container, but it still lacks of resolution. I'm playing with container size of the plugin scene, but I'm breaking everything very quickly. I'm not able to look at it further this week, but I'm keen to learn from your plugin to get that second 2D view screen.

Meta-Ben commented 2 months ago

I will continue to check when I can, though maybe not with pixel art images.

Don't hesitate to share your thoughts or progress on your investigation here or in a discussion topic on the repo. I will try to help you as best as I can.

If you succeed in fixing the problem on your own, don't hesitate to open a PR that I can review and merge for other users who might face the same issue. 😊

bencmckenna commented 2 weeks ago

I just wanted to chime in - I was also having this issue and managed to resolve it by modifying res://addons/Previewer_2D_3D/Previewer2D3D.tscn

Both the Preview and TextureRect control nodes were the wrong size for my editor: nodes res

So I set them both to Full Rect: fullrect

Not sure if it was necessary, but I also changed the 3D_Viewport and 2D_Viewport nodes to match the resolution I wanted.

And most importantly, I had to disable and re-enable the addon in the editor settings.

It's a great addon by the way! Very useful for my purposes. 😃

Meta-Ben commented 2 weeks ago

Hello @bencmckenna

Great finding !!! Thanks a lot for taking the time to dig in I didn't succeed to reproduce so I was a bit blocked to help !

If you want to contribute and open a PR maybe @leon196 could test it too ? then i will merge it into the project ! 😄

bencmckenna commented 2 weeks ago

@Meta-Ben I actually made some modifications so that it swaps between the native 2D/3D editors when I hover the mouse over the preview panel. I find it a bit more intuitive for my purposes, but it's a bit of a departure from your original implementation.

https://github.com/user-attachments/assets/f105c504-8dd7-4392-8f01-f65effd9a0cd

Would it be worth adding to the PR?

Meta-Ben commented 2 weeks ago

@bencmckenna Its an amazing modification, I really love it !!

I think it could be nice to implement it in a separate PR ! Like, one for the fix of @leon196 problem and another one with this cool enhancement !

Meta-Ben commented 2 weeks ago

I approved the PR @bencmckenna, are you able to merge it ? ( if not I will do it )

bencmckenna commented 1 week ago

@Meta-Ben Thanks! I don't think I can merge it, you'll need to do it on your end :)

leon196 commented 1 week ago

Hello,

I've tried the pull request but it seems that the layout is out bounds (the gray area in the screenshot below): Screenshot from 2024-11-18 09-14-48

At the moment I've come with an alternative where I control the 3D camera by selecting the frame itself image

Meta-Ben commented 1 week ago

Thanks for your test @leon196, can you share your godot version + OS ? I think I will do more test on the PR to avoid breaking things @bencmckenna maybe you can try to open the second PR with the 2D/3D behavior you made on the current base if possible ?

leon196 commented 1 week ago

that was a screenshot from Godot 4.3 on Zorin OS 17 (Ubuntu 22)

Meta-Ben commented 1 week ago

I tried on 4.3 too but on MacOs and no issue

Mmmmh I think that to avoid breaking thing we can skip the fix for now, see if more people come in this issue or if someone managed to find a workaround or if more tester come for the PR, if the code evolve too much I can make the PR follow the main branch over time

And maybe @bencmckenna you can open a PR without the fix but with your feature enhancement implementation ( 2D/3D switch on panel hover ), what do you think ?

bencmckenna commented 1 week ago

@leon196 Thanks for testing! Sorry it didn't work. I'm a bit out of my league working with control nodes so I'm not sure what could be causing the issue... 😅 I'll look into.

@Meta-Ben No problem - I still have a few problems I still need to iron out, but I should be able to make it available for testing later in the week.