-
-
Save SableRaf/d467afdbbb8302a57f93e1bc44e46525 to your computer and use it in GitHub Desktop.
Possible Unhandled Promise Rejection: ReferenceError: Property 'VertexAttribute' doesn't exist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Materials = require('Materials'); | |
const Textures = require('Textures'); | |
const Shaders = require('Shaders'); | |
const Time = require('Time'); | |
const Reactive = require('Reactive'); | |
const Diagnostics = require("Diagnostics"); | |
const {log} = require('Diagnostics'); | |
async function main() | |
{ | |
const myMaterial = await Materials.findFirst('material0'); | |
const myCameraTexture = await (await Textures.findFirst('cameraTexture0')).signal; | |
log('this prints'); | |
let uvs = await Shaders.vertexAttribute(VertexAttribute.TEX_COORDS).catch(err => log(err)); | |
log('this does not print'); | |
let ct = Reactive.mul(Time.ms,0.001); | |
let curve = Reactive.abs(Reactive.sin(ct)); | |
let color = await Shaders.textureSampler(myCameraTexture, uvs).catch(err => log(err)); | |
let modulationColor = Reactive.pack4(curve,0,0,1); | |
let finalColor = Reactive.mul(color, modulationColor); | |
myMaterial.setTextureSlot('DIFFUSE', finalColor); | |
}; | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment