I wanted to make an Outline shader, but only achieved the following. Works perfectly exclusively on the sphere. And in Cuba, it hardly works at all. Who have to use the Shader Graph, please help!
I tried to recreate your shader, do you have the correct shader type?
the effect that you're creating there is going to put an emission on faces that are a certain angle. it does not work to create an outline shader in the shader editor. here is a youtube tutorial to create the type of effect that you're trying to achieve https://youtu.be/SMLbbi8oaO8
Old post, but I have found a very easy way to do a simple outline shader. This is in the newest version of Unity (Unity 2022.1.0b14.2951).
Here's the graph:
Here are the settings:
And here are the results:
It starts to show its negative qualities when two outlined objects intersect, however.
Related
I started working on a simple game engine and I'm trying to implement some 3D objects.
I have the basics, a simple test shader, but for some reason, the texture always appears as black. I rewrote everything once already, the problem is still there. I don't know what I'm doing wrong, I'm very much a beginner when it comes to graphics and OpenGL.
The running project is Game. In GameEngine there is the Mesh code, Shader and Texture2D.
Here is my GitHub repository: ChronosEngine
Edit:
Code is now fixed.
I didn't actually read your Code, but usually the issue you describe is caused by a missing light source. Try to apply some light and it might work.
I am working with XNA 3.0 (sigh, I know) and I am working off a tutorial that helps implement a 3d scene with objects where a spot light hits a torus and projects a hard-edged shadow. Now, I want to know where I can find help (tutorial, source code, snippet) to soften said shadow?
Simplest way would be use Percentage Closer Filtering. Basically it works by taking a few shadow map samples. You can start from an article in GPU Gems.
I've used the .NET port of LibNoise to create a planetary map using its built-in sphere projection. However, now I want to wrap that texture around a sphere in XNA. I've got a sphere model, but I know very little about UV wrapping, etc. It's entirely possible, if not plausible, that the way I've put UV coordinates on my model absolutely will not work with the generated texture.
I've set up a small test project rather than fiddle around in my main game. It's your basic rotating model project. I'm using BasicEffect on the model and setting the Texture parameter as my map. However, all I see is the model with its default diffuse color and no texture.
For your convenience, the full code of the project:
Game1.cs
PlanetTerrainMap.cs
Required files:
sphere.fbx
EarthLookupTable.png
Also, I totally recognize that my map does not look like a map. I can handle that issue later. I just want to see all that crappy grain noise on the sphere so I can move forward.
Do I need to use a custom shader? Or do I need a different model?
Have you tried opening this in Blender? It's a great way to confirm if the UV coordinates specified in your model line up to the texture that your trying to use. If it's not going to render after it's imported in to Blender, it's highly likely you won't get it to Render in XNA without specifying the mapping yourself.
I have made a terrain that is generated from a height map file where each pixel (black to white) represent the height of the terrain at the corresponding location.
Now, my question is how would one make a map editor for something like that? I can think of two general ways:
1) The map editor modifies the height map file and regenerates the terrain based on that.
2) The map editor directly alters the vertices of the map, and later upon saving process it generates a height map based on those vertices.
Do you have any good tutorials or resources as to how to get either one to work? I have no idea where to begin.
Check out the XNA Terrain Editor by Eric Grossinger.
I've played around with this thing a little bit and it's pretty slick and should, at the very least, give you some ideas if not an out-right solution.
This book: Building XNA games is an excellent reference and has a great overview of how to create your map editor. The only downfall is it's in XNA 2.0 so you would have to do some converting, but the idea remains the same.
I would like to do something like this: a rotating cube on a form. I don't want to use any external library or dll, just pure .NET 3.5 (without directx). And a cube build with lines only. Could you please tell me how to do this?
I don't want to use external libraries because I don't need > 100 MB library to do this thing right? I want only to animate a rotating cube made with lines.
This is how you go about making a Cube in GDI+
C# 3D Drawing with GDI+ Euler Rotation
http://www.vcskicks.com/3d-graphics-improved.html
C# 3D-Drawing Cube with Shading
http://www.vcskicks.com/3d_gdiplus_drawing.html
Study assignment? This can be done with some simple 3D maths. You just need to understand the basics of matrix algebra, 3D transformations, and 3D->2D view transformation. The DirectX tutorial covers this, but you can google for it and you'll get plenty of other tutorials.
Added: Just to clarify - I'm not suggesting to use DirectX or anything. You can do this with standard System.Drawing tools. You just need to understand the math, and that's explained in the DirectX tutorials.
You might try using WPF and the 3D Tools source code released by the WPF team.
3DTools
Assuming you are using WPF for your GUI:
Make an animated PNG of the cube using a graphics program.
Use the APNG WPF Control to insert the image into your GUI.
This will yield a small assembly size and transparent background if needed.
You need a way to represent 3d points. There is no ready struct for that in .NET unless you use directx or WPF.
Then with a standard euler rotation matrix applied to the points you get the transformed points. If you only do rotations you can get away with 3x3 matrix, but if you want translation you better use 4x4 matrices and homogenous points.
After this you need a way to project those 3d points to the 2d canvas. Depending whether you are using perspective or orthographic projection the projection matrix will look a bit different.
Look into WPF in general, it will help you do this with a few measly lines of code. You can also host a WPF window in Forms.
http://msdn.microsoft.com/en-us/library/aa970268.aspx