I wanted to write a simple short and sweet tutorial on how to export Substance Painter work to A-Frame.

First thing, make sure you are using OpenGL normals. WebGL is related to OpenGL and uses the same normals system.

Second. make sure your texture colors channels are using linear color scale. By default they are “sRGB8”. If you don’t change this and export, your base color in particular will look too dark! Change all color channels from “sRGB8” to “RGB8”.


Over the holiday I decided on a whim to checkin on an issue I’d submitted to the A-Frame project several years ago.

The TLDR is that I was annoyed at the lack of exposure of the various kinds of maps that existed on the material component. The situation at the time had reduced some of the most powerful physical based rendering (PBR) maps to single digit values even though ThreeJS had gained the ability to render them and environtal maps were available.

I was pleasantly surprised to see after the course of a year or so people eventually thought it…


Welcome back! Last time together, we took a look at all the details of uploading the bytes of a web assembly program into our interpreter. Today we’re going to write the code for handling the most basic program.

#[no_mangle]
pub fn main(_args:usize,_len:usize) -> usize {
return 42;
}

Before we begin, I want to show you the final code we’ll be making and work backwards.

let program = Program::parse(&wasm_bytes)?;    
let main_function = program.find_exported_function("main")?;
let main_code = program.find_code_block(main_function.index)?;
if let Instruction::I32Const(num) = main_code.code_expression[0] {
Ok(num as f64)
} else {
Err("Interpreter can't do anything else yet.".to_string())
}

Wait what? That’s it…


Hey everyone. I’m a bit obsessed with web assembly, so I thought i’d tried to write some semi-higher quality information about what I’ve learned. Some months ago I just started reading the web assembly spec and poking around at bytes. It all started as just a fundamental question “what’s even in here?” What makes the magic of all this “faster than JavaScript” stuff work? It ended up being pretty fascinating, and several mad science projects later, I found myself recently with a desire to make a web assembly interpreter. Let’s learn as we go!

One of the neat things about…


Let me tell you the story about two worlds. Javascript and Web Assembly. They are the two most powerful supported runtimes in browsers at the current moment with some serious trade offs:

Javascript

Pros

  • Can talk to the DOM directly
  • Is always the first thing that is executed in browsers
  • Can do multiple threads vs web work workers

Con

  • Very slow at math
  • Has very little control over memory management

Web Assembly

Pros

  • Supports a variety of languages
  • Extremely fast
  • Full control over memory

Cons

  • single process
  • no access to environment

Pretty much the only game in town right now…


I wanted to write an article about one aspect of Rust I really put off for a long while — lifetimes. They are one of the hardest parts about Rust to wrap one’s brain around. Many of us are simply not used to a compiler with a paradigm around memory ownership where such things are needed.

Lifetimes help the compiler make your code safer (i.e. less prone to crashing by using unexpected places in memory). Even if we don’t write them in our code, the compiler is smart enough to figure out your lifetimes without you under the covers. …


Sometimes small details make us feel good. Those who use Julia might know the classic

julia -e "println(\"hello\")"

Let’s say I wanted to put this into a script for me to execute from a terminal, it’d be kind of messy to put in a script file as is.

Let’s create file called “hello” (note no .jl ending).

#!/bin/sh
#=
exec julia -O3 "$0" -- $@
=#
println("hello")
println(ARGS)

Looks kind of weird, but this is both a valid script and a valid Julia program! It’s a script that executes it’s own file and passes the arguments to it.

“#” is…


I’ve been super inspired by Julia lately, and being a person who likes pushing the edge of performance of technologies, one of the first things I was interested in how fast does HTTP.jl run? Turns out it’s pretty competitive when tuned right.

But one question loomed in my mind? How was a language that makes distributed computing so easy taking advantage of it in web serving. It turns out sadly, it is not. If you try spawning two servers in two different processes.

using Distributed
addprocs(1) # create a proc
@everywhere using HTTP
@everywhere function runserver()
HTTP.serve("0.0.0.0",8001) do request::HTTP.Request…


A common dream of many developers have of web assembly is this idea that the web can be written in any language. But one story you don’t hear often talked about is the idea of web having multiple languages work together.

Today I want to present to you an idea I’ve been working on in my project web-dom called dynamic dispatch.

Dynamic dispatch allows someone to call a function on a web assembly module from another web assembly module. Why might you do this you ask? Right now much of the web is thinking of web assembly as a bundled…

Richard Anaya

Data Engineer, Code Philosopher, & Robot Psychologist

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store