penumbra icon indicating copy to clipboard operation
penumbra copied to clipboard

Documentation improvement

Open InfiniteProductions opened this issue 8 years ago • 4 comments

I believe Penumbra deserve a better documentation, including subtle tweaking of items parameter (lights and hulls), some tips & tricks (like what is fastest/cutest for example) etc

I know I'm not the best to talk about writing documentation :P and I understand what it could be, but as good as a library is, it is nothing without proper documentation, hope you'll agree. You can also let me know if you need some help, as a beginner users, I can help at least by pointing where I have some trouble understand something or deal with an issue on my own.

InfiniteProductions avatar Apr 24 '16 15:04 InfiniteProductions

Couldn't agree more about the documentation. I was unsure if people even had any interest in this kind of library and therefore didn't invest too much of my time on the docs. I need to figure out if it's enough to simply improve the readme file on GitHub or make use of GitHub's wiki section instead.

I'd be very interested in knowing what have been the most problematic and hard to figure out things when it comes to Penumbra. Also, any ideas on how to improve the API itself are welcome.

discosultan avatar Apr 24 '16 16:04 discosultan

I can't speak for everyone, for sure, but there is some interest, look at MonoGame.extended, Dilan, it's main author, has planned to add it, but I don't think Penumbra would work as MG.Ext is truly multi-platform (PCL). I think the wiki would be better for everyone, you included, as things can be sorted out and well organised (lights, hulls, small examples, complex examples, ...)

I've just started and I already encounter some trouble creating a simple hull and a point light ( penumbra-issue1

with this:

plight1 = new PointLight()
            {
                Position = new Vector2(256, 256),
                Radius = 480.0f,
                Scale = new Vector2(300),
                CastsShadows = true,
                ShadowType = ShadowType.Solid,
                Intensity = 2.8f,
                Color = Color.YellowGreen
            };

            penumbra.Lights.Add(plight1);

            hull1 = new Hull(new Vector2(1.0f, 1.0f), new Vector2(1.0f, -1.0f), new Vector2(-1.0f, -1.0f), new Vector2(-1.0f, 1.0f))
            {
                Position = new Vector2(100, 300),
                Scale = new Vector2(200, 50)
            };

with MonoGame 3.5.1 on win7 64b.

InfiniteProductions avatar Apr 24 '16 17:04 InfiniteProductions

The radius property of the plight1 seems to be way too big, hence the weird artifacts.

The radius does not reflect how far the light rays reach, instead it determines the radius of the light source (the circle where light emanates from). It will only affect the shadows (how big is penumbra and umbra regions of a shadow). Scale is what determines how far the light rays travel.

discosultan avatar Apr 24 '16 18:04 discosultan

You see !

You may change the properties' names and/or add documentation about them. IMHO: replace radius/scale by size/radius-distance-attenuation(distance) or something more relevant and meaningful.

Allow defining the size of the light is unusual, the common approach is to consider a point light as a single point (for "big" light, we have to create a sphere and using an emissive texture, for example in Unity), so its name. Perhaps the size of the light itself may be made as optional/"hidden" property, I mean something we don't need or don't have to use in most cases.

InfiniteProductions avatar Apr 25 '16 07:04 InfiniteProductions