Homebrew app Question: can't figure out why my hame won't compile

some_guy_on_the_internet

Active Member
OP
Newcomer
Joined
Mar 27, 2024
Messages
41
Trophies
0
Age
24
XP
190
Country
United States
I am trying to compile this homebrew app (learning unity for 3ds) and am following this Tutorial. But I can't try testing it in unity or compiling it of r3ds and it give me these errors. can't understand them. I am using a m3 pro MacBook pro running windows 11 in parallels desktop.
 

Attachments

  • Screenshot 2024-05-27 at 2.48.30 PM.png
    Screenshot 2024-05-27 at 2.48.30 PM.png
    870.7 KB · Views: 27
  • Screenshot 2024-05-27 at 2.48.37 PM.png
    Screenshot 2024-05-27 at 2.48.37 PM.png
    880.4 KB · Views: 27
  • Screenshot 2024-05-27 at 2.48.43 PM.png
    Screenshot 2024-05-27 at 2.48.43 PM.png
    859.8 KB · Views: 30
  • Screenshot 2024-05-27 at 2.48.48 PM.png
    Screenshot 2024-05-27 at 2.48.48 PM.png
    836 KB · Views: 27
  • Screenshot 2024-05-27 at 2.48.51 PM.png
    Screenshot 2024-05-27 at 2.48.51 PM.png
    808.8 KB · Views: 32

Th3Travler

Active Member
Newcomer
Joined
Dec 4, 2023
Messages
43
Trophies
0
XP
366
Country
Argentina
Hello Some,

Unity 5.6.5 by default uses a fragment ( pixel ) based shader for Textmesh. The 3DS does not support Pixel based shaders you need to change the shader material of your Textmesh shaders.

Use this shader :

Code:
Shader "3DS/GUI/3DSFont"
{
    Properties
    {
        _MainTex ("Font Texture", 2D) = "white" {}
        _Color ("Text Color", Color) = (1,1,1,1)
    }
   
    SubShader
    {
   
        Tags{"QUEUE" = "Transparent" "IGNOREPROJECTOR" = "true" "RenderType" = "Transparent" }

        ZWrite Off
        Lighting Off
        Fog { Mode Off }

        Blend SrcAlpha OneMinusSrcAlpha
   
        Pass
        {
            // Use the alpha channel of the texture to mask the color
            SetTexture[_MainTex]
            {
                   constantColor[_Color]
                   Combine texture alpha * constant
            }
           }
     }
Fallback "GUI/Text Shader"
}

note that you cannot change the shader used by the built-in Unity fonts.
You need to import a TTF font into the project, create a new material based on this shader, set the texture on the material to the Font Texture of the imported font, and then add the material to the Materials list in the MeshRenderer component of the TextMesh game object.



text.jpg
 
Last edited by Th3Travler,

kijetesantakalu042

Man with 27 testicles
Member
Joined
Aug 3, 2024
Messages
624
Trophies
2
Location
planet x65943
XP
1,359
Country
Antarctica
Code:
Shader "3DS/GUI/3DSFont"
{
    Properties
    {
        _MainTex ("Font Texture", 2D) = "white" {}
        _Color ("Text Color", Color) = (1,1,1,1)
    }
  
    SubShader
    {
  
        Tags{"QUEUE" = "Transparent" "IGNOREPROJECTOR" = "true" "RenderType" = "Transparent" }

        ZWrite Off
        Lighting Off
        Fog { Mode Off }

        Blend SrcAlpha OneMinusSrcAlpha
  
        Pass
        {
            // Use the alpha channel of the texture to mask the color
            SetTexture[_MainTex]
            {
                   constantColor[_Color]
                   Combine texture alpha * constant
            }
           }
     }
Fallback "GUI/Text Shader"
}
After spending several days writing shaders in picasso what ever shading language that is looks like heaven.
 

Th3Travler

Active Member
Newcomer
Joined
Dec 4, 2023
Messages
43
Trophies
0
XP
366
Country
Argentina
After spending several days writing shaders in picasso what ever shading language that is looks like heaven.
:lol: Its Unity Shader lab which translates to Gl ES1.1 - its too bad Unity 5 removed some of the more robust GL commands from Unity. Not having Tex gen, reflect or sine has made making Unity shader models quite challenging...

but yeah writing shaders in the other available languages is quite a nightmare. Good news is at least you are not locked out of any effects. I don't know squat about real graphics programing I just use Shader lab which is lightyears easier to understand then C ++. I was an artist long time ago so sadly I need a packaged engine with an editor.
I wish I could do something more custom and legally free and clear to use. for a free demo Unity will do but long term i hope Godot 4 for 3DS is in a working state by then.

for any reading there are 4 graphics libraries the 3DS can execute.
GL, which is feature rich but sadly slower, GD which is not as compatible as the GL library but a little faster.
GR which support direct creation of 3D commands. It is the fastest library but requires a mountain of registers knowledge. and then Nintendo's NW4C library..Which my guess is probably the best one to use but then you are stuck with NW4C's tool chain.
 

kijetesantakalu042

Man with 27 testicles
Member
Joined
Aug 3, 2024
Messages
624
Trophies
2
Location
planet x65943
XP
1,359
Country
Antarctica
but yeah writing shaders in the other available languages is quite a nightmare.
It's not even a shader language. It's just raw assembly for the 3ds's pica200
for any reading there are 4 graphics libraries the 3DS can execute.
GL, which is feature rich but sadly slower, GD which is not as compatible as the GL library but a little faster.
GR which support direct creation of 3D commands. It is the fastest library but requires a mountain of registers knowledge. and then Nintendo's NW4C library..Which my guess is probably the best one to use but then you are stuck with NW4C's tool chain.
If you could give me a link to those it'd be nice. I've personally been using libctru with citro3d.
 

Th3Travler

Active Member
Newcomer
Joined
Dec 4, 2023
Messages
43
Trophies
0
XP
366
Country
Argentina
I recommended these manuals - They can steer you in the right direction. I am not a real graphics programmer ( self taught ) so sadly cant dig into writing a graphics engine with shader support. Themes some deep waters and why I use unity.

Note I can not link directly to these files since its against Gbatemp TOS.
( These are the official 3DS manuals from Nintendo )
I can give you the names of the manuals, It is all googleable. The Manuals will describe the name of demo files you can hunt for as well. It is all on the web.

3DS Programming manual Basic Graphics
3DS Programing manual Advanced Graphics
CTR ShaderDebuggerReferenceManual
Nintend ORCS_Manual-en
Nintendo3DS_GPU_Debugger_Manual

for GL - uses Open GL ES 1.1 ( there are a few 2.0 features but mostly your coding in 1.1 which is the fixed function shader pipeline.

https://cn.khronos.org/opengles/1_X
https://registry.khronos.org/OpenGL-Refpages/es1.1/xhtml/

dig for 1.1 from there. ( This is what I have been using as a indirect guide with Unity ) basically I hunt for a gl es 1.1 shader and translate it into a Unity Shader Lab syntax.

for GD, GR - and NW4C I have not messed with it but the Programing manuals I'm sure will explain how to put those libraries into use.

Also I recommended GPU Gems, Sounds like you probably already know this stuff but for anyone else trying to understand graphics. this is a good series of books. They are free from Nvida. Bare in mind these books will not give you code that can run on the 3DS its not open gl code but for anyone trying to understand game graphics this was very helpful...least to me.
https://developer.nvidia.com/gpugems/gpugems/contributors

Hope this helps :)
 
Last edited by Th3Travler,

some_guy_on_the_internet

Active Member
OP
Newcomer
Joined
Mar 27, 2024
Messages
41
Trophies
0
Age
24
XP
190
Country
United States
this is the only error I get now and it says this:
unhandled exception:

at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0025f] in <db3bb19633e54c9085261341fffba7c1>:0

at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean isAsync, System.Boolean anonymous) [0x00000] in <db3bb19633e54c9085261341fffba7c1>:0

at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access) [0x00000] in <db3bb19633e54c9085261341fffba7c1>:0

at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess)

at Mono.CSharp.AssemblyDefinition.Save () [0x00197] in <299f89f00faa44178fd1404a3e8108f9>:0

at Mono.CSharp.Driver.Compile () [0x0035d] in <299f89f00faa44178fd1404a3e8108f9>:0

at Mono.CSharp.Driver.Main (System.String[] args) [0x00052] in <299f89f00faa44178fd1404a3e8108f9>:0
FATAL UNHANDLED EXCEPTION: System.IO.IOException: Sharing violation on path C:\Users\macmoffitt\Downloads\3ds game\Temp\Assembly-CSharp.dll.mdb

at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0025f] in <db3bb19633e54c9085261341fffba7c1>:0

at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean isAsync, System.Boolean anonymous) [0x00000] in
<db3bb19633e54c9085261341fffba7c1>:0

at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access) [0x00000] in <db3bb19633e54c9085261341fffba7c1>:0

at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess)

at Mono.CSharp.AssemblyDefinition.Save () [0x00197] in <299f89f00faa44178fd1404a3e8108f9>:0

at Mono.CSharp.Driver.Compile () [0x0035d] in <299f89f00faa44178fd1404a3e8108f9>:0

at Mono.CSharp.Driver.Main (System.String[] args) [0x00052] in <299f89f00faa44178fd1404a3e8108f9>:0

Post automatically merged:

here is my project: download link
 

Th3Travler

Active Member
Newcomer
Joined
Dec 4, 2023
Messages
43
Trophies
0
XP
366
Country
Argentina
this is the only error I get now and it says this:
unhandled exception:

at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0025f] in <db3bb19633e54c9085261341fffba7c1>:0

at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean isAsync, System.Boolean anonymous) [0x00000] in <db3bb19633e54c9085261341fffba7c1>:0

at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access) [0x00000] in <db3bb19633e54c9085261341fffba7c1>:0

at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess)

at Mono.CSharp.AssemblyDefinition.Save () [0x00197] in <299f89f00faa44178fd1404a3e8108f9>:0

at Mono.CSharp.Driver.Compile () [0x0035d] in <299f89f00faa44178fd1404a3e8108f9>:0

at Mono.CSharp.Driver.Main (System.String[] args) [0x00052] in <299f89f00faa44178fd1404a3e8108f9>:0
FATAL UNHANDLED EXCEPTION: System.IO.IOException: Sharing violation on path C:\Users\macmoffitt\Downloads\3ds game\Temp\Assembly-CSharp.dll.mdb

at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0025f] in <db3bb19633e54c9085261341fffba7c1>:0

at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean isAsync, System.Boolean anonymous) [0x00000] in
<db3bb19633e54c9085261341fffba7c1>:0

at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access) [0x00000] in <db3bb19633e54c9085261341fffba7c1>:0

at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess)

at Mono.CSharp.AssemblyDefinition.Save () [0x00197] in <299f89f00faa44178fd1404a3e8108f9>:0

at Mono.CSharp.Driver.Compile () [0x0035d] in <299f89f00faa44178fd1404a3e8108f9>:0

at Mono.CSharp.Driver.Main (System.String[] args) [0x00052] in <299f89f00faa44178fd1404a3e8108f9>:0

Post automatically merged:

here is my project: download link
OK i just downloaded your project -

few gotchas -

1. Banner files images are not the correct format which is "Nintendo TGA file format" not to be confused with regular TGA format. The image format in your banner folders is currently .PNG

You can not use .png files for the banner - While you can use .png files for your 3DS unity project, Banner files run on a separate exporter and will not convert any file formats they will only accept .ctex or Nintendo TGA files (NW4C .TGA)
For Banners I recommend NW4C Tga file format rather than ctex.

1731201815621.png

you have 2 options to fix the banner problems.
A. you can convert every png to a NW4C TGA in all the folders
or
B. delete all folders after COMMON and copy and paste one of the png files into COMMON\texture and convert it to
a NW4C TGA

1731203894142.png

Story is when unity made the 5.6.5 release they accidently made the sample package with png files instead of proper format.
I hear it got fixed in later versions - This will fix the banner export fail.


2 You made the shader and the material but you didn't apply it to the text mesh :)
1st drag the material onto the textmesh
1731204546083.png


next you need to adjust some settings.
selecting the textmesh to see its properties
1. Setup anchor and alignment and font size
2. Open your TTF font with the little arrow icon next to the font - there is a image file inside the TTF file format
3. Drag the imbedded image to the font texture window ( once done words should become legible )
4. replace textmesh in text field with whatever you want to type

1731205162288.png

once all that is fixed give it a export spin :)
 

Attachments

  • 1731204933450.png
    1731204933450.png
    204 KB · Views: 2
  • 1731204970893.png
    1731204970893.png
    205.9 KB · Views: 5
Last edited by Th3Travler,

Th3Travler

Active Member
Newcomer
Joined
Dec 4, 2023
Messages
43
Trophies
0
XP
366
Country
Argentina
but I don't have photoshop
Well you have a few choices...

1. You can find photoshop, it is online - its a pain but it is the only way I know you can make a 3D model custom banner.
if you hunt for it make sure its an old one like CS5 or CS6, or the tools may not work. I use CS5 Extended. but for tool installation simplicity I recommenced CS6 other wise you got to edit the .bat file, not fun :wtf:

2. You could try 3DSBannerMaker, its a tool I ran into when I was trying to figure out how to make a custom banner. Got the official tools working so I never used it but here it is -> https://github.com/AlbertoSONIC/3DS_Banner_Maker
could not find any documentation or images but maybe that will work for at least a 2d image banner. Let me know if its any good ;)

3. Always know you can just delete the banner folder from your project for now. it will export fine without the banner folder. Unity will build with a generic banner. It wont be custom but that's not a big deal at the start of a project.
 
Last edited by Th3Travler,

some_guy_on_the_internet

Active Member
OP
Newcomer
Joined
Mar 27, 2024
Messages
41
Trophies
0
Age
24
XP
190
Country
United States
I try to build and compile for 3ds without the custom banner and it gives me network errors in the code but I do not want any networking in the game/app and I do not know how to remove and fix it
Post automatically merged:

most of the time the only error in the console when trying to build is "Error building Player because scripts have compile errors in the editor"
 
Last edited by some_guy_on_the_internet,

Th3Travler

Active Member
Newcomer
Joined
Dec 4, 2023
Messages
43
Trophies
0
XP
366
Country
Argentina
I try to build and compile for 3ds without the custom banner and it gives me network errors in the code but I do not want any networking in the game/app and I do not know how to remove and fix it
Post automatically merged:

most of the time the only error in the console when trying to build is "Error building Player because scripts have compile errors in the editor"
So I went to export your files and there are a few thighs you need to setup in -> File - Build Settings - Player settings for the export to work

1. make sure your scene is listed in the "Scenes in Build"
2. goto player settings

"I will mention 3 as a bonus" You could export a dev cia from here if you have dev hardware.
This cia can only be read by dev hardware. A modded 3DS will not install this cia type.
simply export out the .CCI file and convert as one normally does.

1731407952601.png



In Player Settings
For you you have to check the EULA box
You must also put text in every name field. make sure you DO NOT put any spaces on the name or you will get export errors
if you want a space you an underscore " _ "
example:

Name_Other <- yes
Name Other <- no
1731389388647.png

I was able to get your example project to export
1731407568787.png

1731407768761.png
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: https://m.youtube.com/shorts/grwnjZRWmMg