Skip to content

Add Custom Nebula Textures Plug-in #4003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 66 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 58 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
0becf70
Add solving plugin.
Dec 11, 2024
067e432
fix CMakeLists
ultrapre Dec 11, 2024
a81de6c
adjust ui form
ultrapre Dec 11, 2024
6fe1cf5
fix CMakeLists
ultrapre Dec 11, 2024
c09fe32
fix for qt5 compilation
ultrapre Dec 11, 2024
d77f398
Add GoTo function
ultrapre Dec 12, 2024
40b6d6f
import new algorithm and fix
ultrapre Dec 13, 2024
6dda9b6
Add note for a function.
ultrapre Dec 13, 2024
afb1384
add custom_textures.json management
ultrapre Dec 15, 2024
a3ce0d0
add loader and configer
ultrapre Dec 15, 2024
56c85a1
config checkstate
ultrapre Dec 16, 2024
b30c92c
re-adjust plugin code
ultrapre Dec 17, 2024
bbaa711
add function to operate single tile. Fix core.
ultrapre Dec 17, 2024
fc8ca24
translate and ui-lock
ultrapre Dec 18, 2024
a9a6efd
update Info.
ultrapre Dec 19, 2024
c75522c
Add notes
ultrapre Dec 19, 2024
77e8c30
Delete images, remove Markdown, enhance apikey
ultrapre Jan 13, 2025
42237a4
make info translatable
ultrapre Jan 13, 2025
f672446
fix CodeFactor
ultrapre Jan 13, 2025
43ffd49
clean code
ultrapre Jan 13, 2025
c1c22fe
fix QMap find overflow
Jan 19, 2025
6d3db08
rename with standard codeStyle
ultrapre Jan 25, 2025
e2fd709
apply codestyle indent
ultrapre Jan 25, 2025
4f4fc1f
fix license rules
ultrapre Jan 25, 2025
1c14865
add plugin guide
ultrapre Jan 25, 2025
00a217e
fix guide tex
ultrapre Jan 26, 2025
1458bef
Ensure that the image is not mirrored
ultrapre Jan 26, 2025
79740d9
fix comment and rename
ultrapre Jan 26, 2025
ec091fa
fix plugin guide
ultrapre Jan 26, 2025
f16f162
add more guide notes
ultrapre Jan 26, 2025
0e14eb8
restoreDefaults, comment, change coord stepSize
ultrapre Jan 26, 2025
e6ede81
standardize log
ultrapre Jan 26, 2025
ab7f3b5
image format, network retry, freezeUiState, coord fmod
ultrapre Jan 28, 2025
a6afec3
input boundary
ultrapre Jan 28, 2025
7303cf2
load when plugin enable
ultrapre Jan 28, 2025
c61dc49
new Ui
ultrapre Jan 29, 2025
f64a1af
design rendering
ultrapre Jan 30, 2025
947d8ad
cancelButton interrupt Solving
ultrapre Feb 3, 2025
7918b1d
double click to center texture
ultrapre Feb 3, 2025
62f9c37
Refresh after loading default texture
ultrapre Feb 3, 2025
949dc2d
brightness Control
ultrapre Feb 3, 2025
b3bcb92
update plugin guide
ultrapre Feb 3, 2025
9fece6b
use R2D D2R
ultrapre Feb 3, 2025
b9d9ce3
small fix: reset retry count
ultrapre Feb 3, 2025
60d7d7c
fix render tester, indicate time of taking effect
ultrapre Feb 8, 2025
7cb14c1
update guide
ultrapre Feb 8, 2025
3d26ed6
add showing button
ultrapre Feb 9, 2025
121384c
clear undefine value
ultrapre Feb 10, 2025
3b50e44
fix checking login status
ultrapre Feb 18, 2025
13fec6f
Merge branch 'master' into nebTexPlug
alex-w Mar 29, 2025
a24a017
redraw coordinate spinboxes at valueChanged
ultrapre Apr 13, 2025
e6c0974
adjust ui form
ultrapre Apr 14, 2025
8acc5c6
Reset coords to plate solution result
ultrapre Apr 14, 2025
1f7a61d
split out plate-solver
ultrapre Apr 14, 2025
ae55075
test passed and clean old code
ultrapre Apr 14, 2025
fb5416f
Repair: add header file
ultrapre Apr 14, 2025
7aba9e1
fix header and update
ultrapre Apr 14, 2025
e2882fd
#4191 BUG FIXING: keep the same form with getShortName()
ultrapre Apr 14, 2025
8df0dcd
clear temp
ultrapre Apr 15, 2025
711ca7b
split 3 classes
ultrapre Apr 15, 2025
a71e741
use PlateSolver::parseWcsText
ultrapre Apr 15, 2025
05b9ba1
rename better
ultrapre Apr 15, 2025
1bbb312
remake comments
ultrapre Apr 15, 2025
d637388
fix review 101
ultrapre Apr 15, 2025
a633cce
adhere coding style for braces
ultrapre Apr 16, 2025
0c2007f
apply clear WCS projection algorithm, 2002A%26A...395.1061G & 2002A%2…
ultrapre Apr 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ ADD_PLUGIN(EquationOfTime 1)
ADD_PLUGIN(MeteorShowers 1)
ADD_PLUGIN(MosaicCamera 1)
ADD_PLUGIN(NavStars 1)
ADD_PLUGIN(NebulaTextures 1)
ADD_PLUGIN(Novae 1)
ADD_PLUGIN(Observability 1)
ADD_PLUGIN(Oculars 1)
Expand Down
1 change: 1 addition & 0 deletions guide/app_config_ini.tex
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,7 @@ \subsection{\big[plugins\_load\_at\_startup\big]}
EquationOfTime & bool & \ref{sec:plugins:EquationOfTime} Equation of Time plugin\\
Exoplanets & bool & \ref{sec:plugins:Exoplanets} Exoplanets plugin \\
MeteorShowers & bool & \ref{sec:plugins:MeteorShowers} Meteor Showers plugin \\
NebulaTextures & bool & \ref{sec:plugins:NebulaTextures} Nebula Textures plugin \\
Novae & bool & \ref{sec:plugins:BrightNovae} Bright Novae plugin \\
Observability & bool & \ref{sec:plugins:Observability} Observability Analysis\\
Oculars & bool & \ref{sec:plugins:Oculars} Oculars plugin \\
Expand Down
3 changes: 3 additions & 0 deletions guide/ch_dso.tex
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,9 @@ \section{Adding Extra Nebula Images}%\label{adding-extra-nebulae-images}
scripts can be run on Windows, Mac, or Linux platforms, using the
\program{Anaconda Python} distribution.

Nowadays, you can quickly plate solve deep space images and add them to the custom texture
module using the Nebula Textures plugin (see section \ref{sec:plugins:NebulaTextures}).

\subsection{Image requirements for inclusion in Stellarium}
\label{sec:dso:adding_images:image-requirements}

Expand Down
1 change: 1 addition & 0 deletions guide/guide.tex
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ \part{Extending Stellarium}
\include{plg_scenery3d} % move to historical?
\include{plg_atTheTelescope} % TelescopeControl, Oculars, various hardware projects with Raspberry, Arduino, ...
\include{ch_scripting}
\include{plg_nebulatextures}

%% TODO: Optional: Maybe extract Chapter "Stellarium at the Telescope" plus more technical info into a proper Part.
%% Also maybe create a Part "Historical and Cultural astronomy"?
Expand Down
102 changes: 102 additions & 0 deletions guide/plg_interfaces.tex
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,108 @@ \section{Solar System Editor Plugin}
\label{fig:SolarSystemEditor:ImportData:FinalView}
\end{figure}

\newpage


\clearpage

\section{Nebula Textures Plugin User Guide}
\label{sec:plugins:NebulaTextures}

The Nebula Textures plugin allows users to customize deep-sky object (DSO) textures, precisely
rendering them in Stellarium like default textures. Astronomy amateurs can use it to create
a collection of their own astrophotography, visual-like sketches, paintings, and even more in
Stellarium. It also serves as a simple client for Astrometry.net, enabling blind-solving and precise
positioning of astronomical images. The plugin's full functionality includes online plate-solving
and positioning of astronomical images, as well as the management and rendering of custom textures.

\subsection{Steps for Online Solving and Texture Management (For Astrophotography)}
\begin{enumerate}
\item \textbf{Prepare an Image}: Prepare a processed rectangular bitmap file of a deep-sky object,
in a format that supports both Astrometry analysis and rendering, such as PNG, JPG, TIF, or GIF.
You should adjust the image background brightness to suit Stellarium
by referencing the nebulae images in the Stellarium \file{nebulae/default} directory. Typical
astrophotography images with TAN projections are fine, but avoid images with high field distortion.
If the image's FOV is too large, it is recommended to manually split it into multiple sub-images beforehand.
\textbf{\textcolor{red}{Ensure that the image is not flipped horizontally or vertically!!!}}
It’s recommended to use a descriptive ID or nickname as the filename.
While Nova Astrometry does not strictly limit image size, keeping it below 20 MP
ensures efficient plate solving.

\item \textbf{Open Image}: By default, the plugin opens the “Solve and Add” page. Click the \button{Open File}
button to select an image file or paste the file path into the “Image Filepath” text box.

\item \textbf{Enter API Key}: Paste your Astrometry API key into the corresponding text box (password
mode by default). If you don’t have one, click \href{https://nova.astrometry.net/api_help}{\textcolor{blue}{\underline{Astrometry ApiKey}}} to obtain it
after registering or logging in. Check \checkbox{Remember me} to store the key for future use.

\item \textbf{Upload and Solve}: Click \button{Online Solve} to begin uploading and solving the image. Ensure system
proxies are disabled to avoid errors. The solving process may take seconds to minutes,
depending on the Astrometry.net server. If you need to stop the solving process, click the \button{Cancel} button.

\item \textbf{View Solving Results}: After successful solving, the image's center and corners' J2000
equatorial coordinates (in decimal degrees) will be displayed.

\item \textbf{Optional Testing}:
\begin{itemize}
\item Click the \guibutton{0.6}{uibtProcess.png} button next to the center coordinates to locate the texture's center.
\item Use \button{Test this texture} to preview the texture. If it overlaps with default textures, check \button{Disable default textures} to avoid visual conflicts.
The \button{Test this texture} button will toggle between “Test this texture” and “Stop test” to start and stop the rendering process.
Remember to click \button{Stop Test} afterward to restore the rendering of the default nebula textures!
The dropdown menu is used to adjust texture brightness, with three options: \textbf{Bright}, \textbf{Normal}, and \textbf{Dark}.
The default \textbf{Normal} setting is suitable for most cases.
\item You can repeatedly press the \texttt{s} key in the main view to toggle star visibility and verify whether the image is aligned accurately.
\end{itemize}

\item \textbf{Add Texture to Storage}: Click \button{Add the Texture to Custom Storage} to permanently save
the texture. The original image will be copied to Stellarium's plugin folder in the user
directory. After adding a texture, you should restart Stellarium to fully integrate the texture into the module.

\item \textbf{Display Settings}: After restarting Stellarium, switch to the \button{Custom Textures} page of the
plugin to manage your custom textures. Options include \button{Show Custom Textures} (showing/hiding textures), \button{Avoid Area Conflict} (avoiding
overlaps with default textures), and \button{Reload} (reloading custom textures).

\item \textbf{Locate a Texture}: Double-clicking a texture item in the list will quickly center the view on that texture.

\item \textbf{Remove a Texture}: To remove a texture, switch to the \button{Custom Textures} page, select it in
the list view and click \button{Remove selected item in Custom Textures}. The configuration file
will update, and the corresponding image file in the plugin folder will be deleted. However,
Stellarium may continue rendering the texture until it is restarted.
\end{enumerate}

\subsection{Steps for Manual Texture Addition (For Sketches, Paintings, etc.)}
The process is similar to the above, except that you don’t need to upload the texture file for solving:
\begin{itemize}
\item Open the image file. Stars in non-astrophotographic images may not align precisely with the
software's stars, so it is recommended to use the texture without stars (de-starring).
\item Input the J2000 equatorial coordinates (in decimal degrees) for the image corners, aligning
with the bitmap display.
\item If needed, use an astrophotography image with a similar field of view (FOV) to obtain
approximate corner coordinates via online solving first. Alternatively, enable Digitized
Sky Survey layers in Stellarium (Disable constellation lines, illustrations, grids, and other
unrelated elements to approximate a realistic effect), adjust the field of view and rotation
to match the texture, and capture a screenshot for solving. After obtaining the solved
coordinates, replace the image path with the texture path.
\item Then, debug and render the texture, adjusting coordinates until the texture stars align
accurately with Stellarium stars. Finally, add the texture to the custom storage.
\end{itemize}

\subsection{Notes}
\begin{enumerate}
\item All uploaded images are automatically assigned a \textbf{CC BY-NC-ND 3.0} license by Astrometry.net
and are not publicly visible by default. Avoid excessive uploads to prevent server
congestion or issues with your API key.
\item After adding a texture, you must restart Stellarium to fully integrate the texture into the
module. The same applies when deleting a texture.
\item To back up your texture library or share it with others, copy the plugin folder from your user
config directory. For Windows, the path is typically:
\begin{quote}
\texttt{\%APPDATA\%\textbackslash Stellarium\textbackslash modules\textbackslash NebulaTextures}
\end{quote}
You can then share this folder with others, and they can place it in the same directory on
their system to use the custom textures.
\end{enumerate}


%%% Local Variables:
%%% mode: latex
Expand Down
13 changes: 13 additions & 0 deletions plugins/NebulaTextures/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SET(NEBULATEXTURES_VERSION "0.1.0")

ADD_DEFINITIONS(-DNEBULATEXTURES_PLUGIN_VERSION="${NEBULATEXTURES_VERSION}")
ADD_DEFINITIONS(-DNEBULATEXTURES_PLUGIN_LICENSE="GNU GPLv2 or later")

ADD_SUBDIRECTORY( src )

IF(APPLE)
SET(CMAKE_INSTALL_PREFIX $ENV{HOME}/Library/Application\ Support/Stellarium)
ElSE(APPLE)
SET(CMAKE_INSTALL_PREFIX $ENV{HOME}/.stellarium)
ENDIF(APPLE)
INSTALL(FILES DESTINATION "modules/NebulaTextures")
Loading
Loading