Coder Social home page Coder Social logo

ies's Introduction

Hi there, I am a SDE.

🏢 Job:Graphics, engine, art.

🛠 Favorite languages:C++ and Hlsl.

💬 Good languages: C++、Hlsl、Glsl、Rust、TypeScript、nodejs、C#(Programming without any language limitations)

📫 Reach me via Email: [email protected]

🎨 Side projects:Technical artistGraphics Engine

ReadmeStats-Image

ies's People

Contributors

ray-cast 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  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ies's Issues

Unable to properly sample IES light on the CPU

Hello,

I am trying to add IES lighting to my CPU renderer. To do so i used your IES parser.
Unfortunetly i am getting wrong results when i sample the lights(IESLoadHelper::interpolatePoint or IESLoadHelper::interpolateBilinear).

For example:
The ground truth: https://imgur.com/CrxT7bv
The result I get: https://imgur.com/pJ7VU5e

My renderer use a right handed Y up coordinate system:
https://i.stack.imgur.com/vg1P7.png

Here is my sampling code:

`

Math::Vec2 dirToSphericalUV(const Math::Vec3& dir)
{
	return Math::Vec2(
		0.5f + 0.5f * atan2(dir.x, dir.z) / 3.1415926f,
		1.f - acos(dir.y) / 3.1415926f);
}

struct SampleToLight
{
	Math::Vec3 L;
	float length;
	float intensityMultiplier = 1.0f;
};

SampleToLight IesLight::generateSampleToLight(const Math::Vec3& P) const
{
	const Math::Vec3 lightWsPosition = this->readPosition();

	SampleToLight sample;
	sample.L = lightWsPosition - P;
	sample.length = glm::length(sample.L);
	sample.L /= sample.length;

	//NOT WORKING
	const Math::Vec2 profileUV = dirToSphericalUV(-1.f * sample.L);
	const float profileCoordH = profileUV.x * (float)m_iesFileInfo->anglesNumH;
	const float profileCoordV = profileUV.y * (float)m_iesFileInfo->anglesNumV;
	sample.intensityMultiplier = m_iesLoadHelper.interpolateBilinear(*m_iesFileInfo, profileCoordH, profileCoordV);

	return sample;
}

`

Thanks in advance for helping.

IES Profiles with -1 luminance

A few ies profiles i have downloaded have the IES -1 for luminance value and so the loader was failing to load them in.

I have removed this check since total lumens is not used anywhere else and we have our own value for light intensity anyway not being fed by the lumen value of the ies profile.

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.