Code Monkey home page Code Monkey logo

lovr-docs's People

Contributors

bferguson3 avatar bjornbytes avatar bobsayshilol avatar brainrom avatar fendrin avatar gp-it-be avatar hmans avatar jminor avatar jmiskovic avatar joestrouth1 avatar johanlunds avatar kelseyhigham avatar mcclure avatar nevyn avatar oilboi avatar paloblanco avatar porglezomp avatar pterror avatar robkohr avatar sgosselin avatar tech2077 avatar udinanon avatar xiejiangzhi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

lovr-docs's Issues

deadlink for webvr html example

relevant markdown is here.

https://github.com/bjornbytes/lovr-docs/blob/master/guides/Distribution.md
[link to htm](https://github.com/bjornbytes/lovr/blob/master/src/resources/lovr.html) in the distribution for webvr no longer exists

A few typos, clarity tweaks, and omissions

small changes

bigger changes

ShaderBlock documentation issues

The ShaderBlock:send notes mention passing tables of numbers, but the method signatures only suggest allowing Blobs:

For scalar or vector types, use tables of numbers or vec3s for each vector.

The signature of lovr.graphics.newShaderBlock doesn't describe the first argument, and it isn't demonstrated on that page, but it is shown on the ShaderBlock main page example.

Postprocessing example broken

The postprocessing example fails with "bad argument #1 to 'fill' (Texture expected, got userdata)".

This part can be fixed with a two-line change.

 local function fullScreenDraw(source)
-  lovr.graphics.fill(source)
+  lovr.graphics.fill(source:getTexture())
 end

 -- ...

     screenShader:send("direction", {0, 4})
-    lovr.graphics.fill(tempCanvas[2]) -- On the final pass, render directly to the screen.
+    lovr.graphics.fill(tempCanvas[2]:getTexture()) -- On the final pass, render directly to the screen.
   end

Unfortunately (at least in the local viewer app on macOS) it renders completely incorrectly, flickering and horizontally duplicating the scene 16 or so times, presumably due to the double-wide texture rendering with the canvas.

• macOS 10.14.6
• LOVR 0.13.0 (Very Velociraptor)
• Intel Iris Graphics 6100 1536 MB

image

Missing documentation for operator overloads

I didn't even realize that __mul and friends were implemented until I did it by accident. Now I'm struggling to figure out which operators can be done between which datatypes. It would be nice will a full documentation set of operators, valid operands, and results. Maybe it could just be a big table under lovr.math.

Add Small 2D Button Example

e.g.

function lovr.draw(pass)
  local width, height = lovr.system.getWindowDimensions()
  local projection = mat4():orthographic(0, width, 0, height, -10, 10)
  pass:setProjection(1, projection)
  pass:setViewPose(1, mat4():identity())
  pass:setDepthTest()

  local button = { x = 30, y = 30, w = 150, h = 60 }

  local mx, my = lovr.system.getMousePosition()
  local pressed = lovr.system.isMouseDown(1)
  local hovered = mx > button.x and mx < button.x + button.w and my > button.y and my < button.y + button.h

  pass:setColor(hovered and (pressed and { .25, .25, .27 } or { .2, .2, .22 }) or { .15, .15, .17 })
  pass:plane(button.x + button.w / 2, button.y + button.h / 2, 0, button.w, button.h)

  local font = lovr.graphics.getDefaultFont()
  font:setPixelDensity(1) -- set units to pixels instead of meters

  pass:setColor(1, 1, 1)
  pass:text('Hi!!!', button.x + button.w / 2, button.y + button.h / 2)
end

Clarify possible values for mesh attribute names in newBuffer documentation

Consider https://lovr.org/docs/v0.16.0/lovr.graphics.newBuffer, case (data, format).

location is the vertex attribute location of each field. This is used to match up each field with an attribute declared in a shader, and doesn't have any purpose when binding the buffer as a uniform or storage buffer. Any fields with a nil location will use an autoincrementing location starting at zero. Named locations are not currently supported, but may be added in the future. [my emphasis]

There are two problems here. First off, contra the bolded text, the sample code uses named locations: https://lovr.org/docs/Intro/Custom_Mesh

So, either the text or the sample code should be changed.

Secondly, which locations/location names are valid by default is not documented anywhere linked from here. This bit of documentation should include a link to https://lovr.org/docs/v0.16.0/Shaders#vertex-attributes

In Safari on macOS, most Example embeds crash the tab or freeze the OS

Since this impacts the ability to use Safari to read documentation, I think it makes sense not to embed Examples in Safari. Or at least hide them behind a play button.

Tested in macOS Monterey 12.2.1, on this Intel Mac.


These don’t crash:

Intro

  • Hello World
  • Spinning Cube
  • 3D Model
  • 360 Photo
  • Tracked Hands

Interaction

  • Controller Models (doesn’t render, but doesn’t crash)
  • Hand Tracking (doesn’t render, but doesn’t crash)

Locomotion

  • Environment
  • Grid
  • Skybox

Lighting

Animation

Physics

  • Boxes
  • Hand Physics
  • Saloon Door

Audio

  • Playback (doesn’t play, but doesn’t crash)
  • Spatialization
  • Sine Wave Generator (doesn’t play, but doesn’t crash)

Effects

  • Stereo Image
  • Cubemap Texturing

UI

Optimization

  • Instancing (freezes for a few minutes, and just renders black eventually, but doesn’t crash)
  • Mask (doesn’t render, but doesn’t crash)

Debugging


These crash:

Intro

  • Shapes
  • Thread
  • Custom Mesh

Interaction

  • Pointer
  • Pointer UI
  • Physics Pointer
  • Dragging

Locomotion

  • Basic Thumbsticks
  • Teleportation Flat
  • Teleportation Colliders
  • Walking In Place

Environment

  • Terrain - Heightmap (technically this eats my GPU and freezes my computer, but doesn’t crash)
  • Terrain - Procedural (technically this eats my GPU and freezes my computer, but doesn’t crash)

Lighting

  • PBR Materials
  • Animation
  • Playback
  • 2 Bone IK

Physics

  • Drawing Colliders
  • Newtons Cradle
  • Wrecking Ball
  • Zip Line

Audio

  • Directivity
  • Mute (doesn’t play; crashes after a few seconds)

Effects

  • Blur

UI

  • Spectator Camera
  • Window HUD

Optimization

Debugging

  • FPS Controls (displays an error for a second, then crashes)
  • Raw Input (crashes after a few seconds)

Some way to activate doc search by clicking/tapping

As of the 0.16 docs, the only way to search the docs is to just start typing. Any keystroke is interpreted as an attempt to initiate a search. While this is very interesting, it has two problems:

  • It is not very discoverable. I assumed doc search had been removed until I activated it by accident
  • There is no way to activate it on mobile— at all

Expected behavior: There should be a magnifying glass button or "search" link somewhere that kicks open the search prompt.

Clarify Animation Timestamps

See bjornbytes/lovr#575.

  • How is the duration of an animation calculated?
  • Do animation timestamps wrap around once they exceed the duration? Or is the final pose held?
  • What happens if the keyframes for the animation don't start at zero?

Breadcrumbs

image

If you're on a page like lovr.math.quat, if you want to jump back to lovr.math you have to scroll down to the "Related" section, which sucks. You should be able to click lovr in the header to go to the lovr page, or math to go to the lovr.math page. For methods on objects, you would click the object name to go to the object's page. It's a sneaky way of implementing "breadcrumb" navigation. Maybe too sneaky...

Phones

Make docs work on phones

Document table shapes

In many places, the LÖVR docs mention that functions take or return a table containing some information, but they don't say what's in the table, just table, leaving me confused about how to access the contents. In all these cases it would be very useful to document the shape(s) of the tables.

Fog

Fog example would be useful in the Lighting section

Function parameters not clear in docs

I think the documentation for functions that have different variations isn't clear. Take Pass:plane as an example. The API documentation states that the transform parameter is a Mat4, or alternatively "can be provided as a position, 2-component scale, and rotation using a combination of Vectors, and numbers.". Would be nice to see each variant form explicitly documented, e.g., Pass:plane( pos_x, pos_y, pos_z, scale_x, scale_y, quat_x, quat_y, quat_z, quat_w, ... ) (if indeed that's an accepted form, i'm not sure...)

2D Text Example

e.g.

function lovr.draw(pass)
  local width, height = pass:getDimensions()
  pass:setProjection(1, mat4():orthographic(width, height, -1, 1))
  pass:setViewPose(1, mat4())

  local font = lovr.graphics.getDefaultFont()
  font:setPixelDensity(1)

  pass:text('hi', width / 2, height / 2, 0, 1)
end

There is Window_HUD but it's not a small snippet like this

Collider:setPose is undocumented

I dunno if this is deliberate or just a recent addition you haven't had time to document it yet; I was calling it as self.collider:setPose(self.transform:unpack()), THEN noticed it's not in the docs and I had just assumed it exists, THEN noticed that that'll send scale as rotation args and be completely wrong, so yeah 😅

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.