Giter Site home page Giter Site logo

bhojpur / render Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 15.26 MB

The Bhojpur Render is a software-as-a-service product used as a Rendering Engine based on Bhojpur.NET Platform for application delivery.

Home Page: https://page.bhojpur-consulting.com/product/render/

Dockerfile 0.01% Go 14.36% Shell 3.35% Makefile 2.06% M4 0.14% HTML 5.32% CSS 0.86% C 25.10% TeX 0.66% Perl 0.14% CMake 0.59% C++ 0.43% GLSL 0.40% JavaScript 46.57%
webassembly wasm javascript emscripten

render's Introduction

Bhojpur Render - Model Processing Engine

The Bhojpur Render is a high performance 2D/3D graphic rendering engine applied within the Bhojpur.NET Platform for delivery of collaborative and distributed applications or services. It features client-side and server-side framework for desktop, web, and mobile application development.

Key Features

This rendering framework provides the following capabilities

  • client-side rendering library for desktop applications (e.g., macOS, Linux, Windows)
  • client-side 3D Model Editor for web using a Javascript engine
  • server-side rendering library for web-based applications

Pre-requisites

The Go >= 1.17 is primary requirement.

  • wasm_exec.js for helper functions. Ensure you are using the same version of wasm_exec.js as the version of tinygo you are using to compile.

You must install TinyGo to be able ro build wasm applications using Go programming language.

$ brew tap tinygo-org/tools
$ brew install tinygo
$ tinygo version

Generate the main.wasm Javascript for your application using following command.

$ tinygo build -o main.wasm -target wasm ./main.go

Now, create an index.html page that loads the main.wasm file. The general steps required to run the WebAssembly file in the web browser includes loading it into JavaScript with WebAssembly.instantiateStreaming, or WebAssembly.instantiate in some browsers:

const go = new Go(); // Defined in wasm_exec.js
const WASM_URL = 'wasm.wasm';

var wasm;

if ('instantiateStreaming' in WebAssembly) {
	WebAssembly.instantiateStreaming(fetch(WASM_URL), go.importObject).then(function (obj) {
		wasm = obj.instance;
		go.run(wasm);
	})
} else {
	fetch(WASM_URL).then(resp =>
		resp.arrayBuffer()
	).then(bytes =>
		WebAssembly.instantiate(bytes, go.importObject).then(function (obj) {
			wasm = obj.instance;
			go.run(wasm);
		})
	)
}

If you have used explicit exports, you can call them by invoking them under the wasm.exports namespace. See the export directory for an example of this.

In addition to the javascript, it is important that the wasm file is served with the Content-Type header set to application/wasm. Without it, most web browsers won't run it.

Finally, host your wasm application using rendersvr CLI tool

$ rendersvr wasm

render's People

Contributors

shashi-rai avatar

Watchers

 avatar

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.